]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] AI12-0042: Type invariant checking rules
authorGary Dismukes <dismukes@adacore.com>
Wed, 3 Jun 2020 23:53:33 +0000 (19:53 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 16 Jul 2020 09:17:55 +0000 (05:17 -0400)
commit7e06a62f5bb4baaf3701a9a29e03c80d2ae50a49
treeb55d885e03702f44a908632cd9dc4d6b9fc7545c
parent6805c1c6a6254b6df6799d820c0d08a3dbfbec96
[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.
gcc/ada/exp_ch4.adb
gcc/ada/sem_ch3.adb