[Ada] AI12-0397: Default_Initial_Condition expressions for derived types
commitd2e59934c4f79791b337470e9ef7c34ef66b1b49
authorGary Dismukes <dismukes@adacore.com>
Mon, 7 Dec 2020 06:58:10 +0000 (7 01:58 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 28 Apr 2021 09:38:06 +0000 (28 05:38 -0400)
tree981419d8f09a7ac810cee98d37a1871a56af59b7
parentbb60efc5c75afa2c409c740b970f5f1e6fdd4890
[Ada] AI12-0397: Default_Initial_Condition expressions for derived types

gcc/ada/

* exp_util.adb (Add_Own_DIC): Suppress expansion of a DIC pragma
when the pragma occurs for an abstract type, since that could
lead to a call to an abstract function, and such DIC checks can
never be performed for abstract types in any case.
* sem_disp.adb (Check_Dispatching_Context): Suppress the check
for illegal calls to abstract subprograms when the call occurs
within a Default_Initial_Condition aspect and the call is passed
the current instance as an actual.
(Has_Controlling_Current_Instance_Actual): New function to test
a call to see if it has any actuals given by direct references
to a current instance of a type
* sem_res.adb (Resolve_Actuals): Issue an error for a call
within a DIC aspect to a nonprimitive subprogram with an actual
given by the name of the DIC type's current instance (which will
show up as a reference to the formal parameter of a DIC
procedure).
gcc/ada/exp_util.adb
gcc/ada/sem_disp.adb
gcc/ada/sem_res.adb