[Ada] Set scope of elaboration flag for 'Access
authorEd Schonberg <schonberg@adacore.com>
Tue, 21 Aug 2018 14:47:18 +0000 (14:47 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 21 Aug 2018 14:47:18 +0000 (14:47 +0000)
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_attr.adb: Set scope of elaboration flag for 'Access.

From-SVN: r263724

gcc/ada/ChangeLog
gcc/ada/sem_attr.adb

index 4afe997d33c1059b27fa550549942f423aeeac8d..312d891fad6fc473d596cd9bf0c8bac37f0d41fe 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-21  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_attr.adb: Set scope of elaboration flag for 'Access.
+
 2018-08-21  Ed Schonberg  <schonberg@adacore.com>
 
        * sprint.adb: Add guard on printing aspects.
index cb1b2d5d2cc71acfad1de5690238244619380557..96eb48824d1162de99eb220a52f9d228ada45bf0 100644 (file)
@@ -11245,6 +11245,15 @@ package body Sem_Attr is
                            New_Occurrence_Of (Standard_Short_Integer, Loc),
                          Expression          =>
                            Make_Integer_Literal (Loc, Uint_0)));
+
+                     --  The above sets the Scope of the flag entity to the
+                     --  current scope, in which the attribute appears, but
+                     --  the flag declaration has been inserted after that
+                     --  of Subp_Id, so the scope of the flag the same as
+                     --  that of Subp_Id. This is relevant when unnesting,
+                     --  whereh processing depends on correct scope settingl
+
+                     Set_Scope (Flag_Id, Scop);
                   end if;
 
                   --  Taking the 'Access of an expression function freezes its