aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2018-08-21 14:47:18 +0000
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2018-08-21 14:47:18 +0000
commit4c397cd59e0928245f087bc00e39a769ace11b4c (patch)
tree5552c65284a8c127c60ddf9f6dcf64674d96624e
parent49daa8a9aa0b0f079f8ecec3838b35f87bd9e222 (diff)
[Ada] Set scope of elaboration flag for 'Access
2018-08-21 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_attr.adb: Set scope of elaboration flag for 'Access. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263724 138bc75d-0d04-0410-961f-82ee72b054a4
-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