When a derived type DT has an untagged private parent type PT with a discriminant, where the full type of PT is tagged, and DT inherits a function F with an anonymous access result that designates the type, the compiler wrongly reports an error saying that DT must be declared abstract or F overridden. A test is added to exclude checking the abstract overriding rules that should only apply to inherited subprograms of tagged derived types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Check_Abstract_Overriding): If the type is derived from an untagged type, then don't perform any of the abstract overriding error checks.