From 65b03d7d594f24807a36b96e1c52c061817cc307 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 27 Oct 2004 15:54:38 +0200 Subject: [PATCH] sem_elab.adb (Check_Elab_Call): Do not check a call that does not appear in the code for the main unit. 2004-10-26 Ed Schonberg * sem_elab.adb (Check_Elab_Call): Do not check a call that does not appear in the code for the main unit. Dependencies among units in the context of the main unit are established when those other units are compiled. Otherwise spurious elaboration constraints can generate incorrect elaboration circularities. From-SVN: r89673 --- gcc/ada/sem_elab.adb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 4248544666a..5c8b3e611b6 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -913,6 +913,14 @@ package body Sem_Elab is -- Start of processing for Check_Elab_Call begin + -- If the call does not come from the main unit, there is nothing to + -- check. Elaboration call from units in the context of the main unit + -- will lead to semantic dependencies when those units are compiled. + + if not In_Extended_Main_Code_Unit (N) then + return; + end if; + -- For an entry call, check relevant restriction if Nkind (N) = N_Entry_Call_Statement -- 2.30.2