summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 89dcb2f4438..d3c735b38ed 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -13008,11 +13008,21 @@ package body Sem_Ch12 is
and then Present (Original_Node (N2))
and then Present (Entity (Original_Node (N2)))
then
- N2 := Original_Node (N2);
- Set_Associated_Node (N, N2);
- end if;
+ if Is_Global (Entity (Original_Node (N2))) then
+ N2 := Original_Node (N2);
+ Set_Associated_Node (N, N2);
+ Set_Global_Type (N, N2);
+
+ else
+ -- Renaming is local, and will be resolved in instance
+
+ Set_Associated_Node (N, Empty);
+ Set_Etype (N, Empty);
+ end if;
- Set_Global_Type (N, N2);
+ else
+ Set_Global_Type (N, N2);
+ end if;
elsif Nkind (N) = N_Op_Concat
and then Is_Generic_Type (Etype (N2))