aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-08-06 00:53:11 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-23 04:24:47 -0400
commit70b590e2481f9a887009e51396727659f49b0def (patch)
treea2aaaaa6550930a3f006588979caf825dd57b0a5 /gcc/ada
parentf9c20bd7853a746b7c9373bff6b92459b53703cd (diff)
downloadgcc-70b590e2481f9a887009e51396727659f49b0def.zip
gcc-70b590e2481f9a887009e51396727659f49b0def.tar.gz
gcc-70b590e2481f9a887009e51396727659f49b0def.tar.bz2
[Ada] Fix scope of index parameter inside a delta aggregate
gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): Push scope of the implicit loop before entering name of the index parameter, not after; enter name no matter if the identifier has been decorated before.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_aggr.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 688937e..d6d0083 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3052,15 +3052,15 @@ package body Sem_Aggr is
begin
Set_Etype (Ent, Standard_Void_Type);
Set_Parent (Ent, Assoc);
+ Push_Scope (Ent);
if No (Scope (Id)) then
- Enter_Name (Id);
Set_Etype (Id, Index_Type);
Set_Ekind (Id, E_Variable);
Set_Scope (Id, Ent);
end if;
+ Enter_Name (Id);
- Push_Scope (Ent);
Analyze_And_Resolve
(New_Copy_Tree (Expression (Assoc)), Component_Type (Typ));
End_Scope;