ada: Fix inheritance of Is_Primitive and legality check for nonoverridable aspects
This patch fixes the identification of inherited subprograms as primitive
operations via the Is_Primitive flag. This is essential in the context of the
new legality check which makes sure that, if any subprogram denoted by a
nonoverridable aspect of a type T with formal or return of either type T or
access T, then all denoted subprograms should be primitive operations. Note
that all valid interpretations of a subprogram are denoted by the aspect under
evaluation, all of these needs to be primitive then.
This is a respin of eng/toolchain/gnat!2039
gcc/ada/ChangeLog:
* sem_ch13.adb (Check_Nonoverridable_Aspect_Subprograms): Add the new
legality check in Check_Nonoverridable_Aspect_Subprograms for
nonoverridable aspects to check whether the denoted subprograms satisfy
MR 13.1.1(18.4/6), otherwise we emit an error. Fix spacing.
* sem_ch6.adb (New_Overloaded_Entity): Set Is_Primitive flag
for inherited primitives, and filter out homonym candidates without a
function specification as parents.