The draft ACATS test (which we developed) for the Ada 2022 feature of user-defined literals has compile-time problems that are fixed with this set of changes. Two of these involve the resolution of named numbers in the context where an implicit literal conversion can occur, and for equality when a literal or named number is an operand. Furthermore, the compiler can hang in some cases when a numeric literal is used in a context where the expected type is a type derived two levels down from a tagged type that specifies a literal aspect. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_Equality_Op): Add handling for equality ops with user-defined literal operands. * sem_util.ads (Is_User_Defined_Literal): Update spec comment to indicate inclusion of named number cases. * sem_util.adb (Corresponding_Primitive_Op): Rather than following the chain of ancestor subprograms via Alias and Overridden_Operation links, we check for matching profiles between primitive subprograms of the descendant type and the ancestor subprogram (by calling a new nested function Profile_Matches_Ancestor). This prevents the compiler from hanging due to circular linkages via those fields that can occur between inherited and overriding subprograms (which might indicate a latent bug, but one that may be rather delicate to resolve). (Profile_Matches_Ancestor): New nested subprogram to compare the profile of a primitive subprogram with the profile of a candidate ancestor subprogram. (Is_User_Defined_Literal): Also return True in cases where the node N denotes a named number (E_Name_Integer and E_Named_Real).