aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/sem_attr.adb9
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 4afe997d33c..312d891fad6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,9 @@
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.
2018-08-21 Javier Miranda <miranda@adacore.com>
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index cb1b2d5d2cc..96eb48824d1 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -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