summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elab.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_elab.adb')
-rw-r--r--gcc/ada/sem_elab.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 4c86ce353a4..1c897c8147f 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -2541,8 +2541,14 @@ package body Sem_Elab is
Scop : Entity_Id)
is
Elab_Unit : Entity_Id;
+
+ -- Check whether this is a call to an Initialize subprogram for a
+ -- controlled type. Note that Call can also be a 'access attribute
+ -- reference, which now generates an elaboration check.
+
Init_Call : constant Boolean :=
- Chars (Subp) = Name_Initialize
+ Nkind (Call) = N_Procedure_Call_Statement
+ and then Chars (Subp) = Name_Initialize
and then Comes_From_Source (Subp)
and then Present (Parameter_Associations (Call))
and then Is_Controlled (Etype (First_Actual (Call)));