[Ada] AI12-0042: Type invariant checking rules
gcc/ada/
* exp_ch4.adb (Expand_N_Type_Conversion): Handle the case of
applying an invariant check for a conversion to a class-wide
type whose root type has a type invariant, when the conversion
appears within the immediate scope of the type and the
expression is of a specific tagged type.
* sem_ch3.adb (Is_Private_Primitive): New function to determine
whether a primitive subprogram is a private operation.
(Check_Abstract_Overriding): Enforce the restriction imposed by
AI12-0042 of requiring overriding of an inherited nonabstract
private operation when the ancestor has a class-wide type
invariant and the ancestor's private operation is visible.
(Derive_Subprogram): Set Requires_Overriding on a subprogram
inherited from a visible private operation of an ancestor to
which a Type_Invariant'Class expression applies.