Prefix of attribute Old is captured either as an object renaming or as an object declaration. This is now taken into account when applying validity checks. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Old]): Adapt to object declaration being rewritten into object renaming.