Ada 2022 specifies that when the controlling type of a formal abstract subprogram declaration is a formal type, and the actual type is a class-wide type T'Class, the actual subprogram can be an implicitly declared subprogram corresponding to a primitive operation of type T (AI12-0165-1/05).
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch8.adb (Build_Class_Wide_Wrapper): Previous version split in two subprograms to factorize its functionality: Find_Suitable_Candidate, and Build_Class_Wide_Wrapper. These routines are also placed in the new subprogram Handle_Instance_With_Class_Wide_Type. (Handle_Instance_With_Class_Wide_Type): New subprogram that encapsulates all the code that handles instantiations with class-wide types. (Analyze_Subprogram_Renaming): Adjust code to invoke the new nested subprogram Handle_Instance_With_Class_Wide_Type; adjust documentation.
patch.diff.gz
Description: application/gzip