summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-16 12:20:00 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-16 12:20:00 +0000
commit73448237b38e6e3283bf016bbc3e2ac29b5ab636 (patch)
tree44234817e6ca847458c9b98e2ec0b75be024b104 /gcc/ada/sem_ch12.adb
parent2fcbd967d11a97db26d240618b84b5ffa9b5c262 (diff)
downloadppe42-gcc-73448237b38e6e3283bf016bbc3e2ac29b5ab636.tar.gz
ppe42-gcc-73448237b38e6e3283bf016bbc3e2ac29b5ab636.zip
2007-08-16 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Copy_Generic_Node): A reference to a child unit of the generic for an enclosing instance is a global reference, even though its scope is the enclosing instance. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index fc649dc625d..f48724db19d 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -5628,6 +5628,8 @@ package body Sem_Ch12 is
-- reset the entity in the generic copy. A global reference has a
-- smaller depth than the parent, or else the same depth in case
-- both are distinct compilation units.
+ -- A child unit is implicitly declared within the enclosing parent
+ -- but is in fact global to it, and must be preserved.
-- It is also possible for Current_Instantiated_Parent to be
-- defined, and for this not to be a nested generic, namely if the
@@ -5658,7 +5660,9 @@ package body Sem_Ch12 is
or else
Nkind (Ent) = N_Defining_Operator_Symbol)
or else No (Scope (Ent))
- or else Scope (Ent) = Current_Instantiated_Parent.Gen_Id
+ or else
+ (Scope (Ent) = Current_Instantiated_Parent.Gen_Id
+ and then not Is_Child_Unit (Ent))
or else (Scope_Depth (Scope (Ent)) >
Scope_Depth (Current_Instantiated_Parent.Gen_Id)
and then
OpenPOWER on IntegriCloud