OSDN Git Service

* sem_elab.adb (Check_A_Call): check for renaming before finding the
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 01:07:23 +0000 (01:07 +0000)
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Oct 2001 01:07:23 +0000 (01:07 +0000)
enclosing unit, which may already be different from the calling unit.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46512 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_elab.adb

index e9fe3dd..a3bdfef 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-25  Ed Schonberg <schonber@gnat.com>
+       
+       * sem_elab.adb (Check_A_Call): check for renaming before finding the 
+       enclosing unit, which may already be different from the calling unit.
+
 2001-10-25  Geert Bosch <bosch@gnat.com>
 
        * 4gintnam.ads: fix header format.
index 555abb8..943161a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.84 $
+--                            $Revision$
 --                                                                          --
 --          Copyright (C) 1997-2001 Free Software Foundation, Inc.          --
 --                                                                          --
@@ -549,18 +549,26 @@ package body Sem_Elab is
             --  Loop to carefully follow renamings and derivations
             --  one step outside the current unit, but not further.
 
-            loop
+            if not Inst_Case
+              and then Present (Alias (Ent))
+            then
+               E_Scope := Alias (Ent);
+            else
                E_Scope := Ent;
+            end if;
+
+            loop
                while not Is_Compilation_Unit (E_Scope) loop
                   E_Scope := Scope (E_Scope);
                end loop;
 
                --  If E_Scope is the same as C_Scope, it means that there
-               --  definitely was a renaming or derivation, and we are
-               --  not yet out of the current unit.
+               --  definitely was a local renaming or derivation, and we
+               --  are not yet out of the current unit.
 
                exit when E_Scope /= C_Scope;
                Ent := Alias (Ent);
+               E_Scope := Ent;
             end loop;
          end if;