After the binding interpretation issued under AI12-0413, a user-defined primitive equality operator of an untagged record type hides the predefined equality operator in an instantiation, but this does not apply if the instantiation appears in the same declarative region as the type and before the declaration of this user-defined operator. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_Equality_Op): Make sure that the user-defined operator of an untagged record type is declared ahead of an instance before using it to resolve the equality operator in the instance.