aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-08-04 17:47:39 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:47 -0400
commite22557ee955225b6a2d42215b5e07b22f18d88d2 (patch)
treeed6660b6860a3ddf52ce2d95413d2b925aa5b348 /gcc
parentf1722339efa953eed5c69ec8869fc62b41e72ee4 (diff)
downloadgcc-e22557ee955225b6a2d42215b5e07b22f18d88d2.zip
gcc-e22557ee955225b6a2d42215b5e07b22f18d88d2.tar.gz
gcc-e22557ee955225b6a2d42215b5e07b22f18d88d2.tar.bz2
[Ada] Use index parameter for iterated_component_association
gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Use existing defining identifier for index parameter.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_aggr.adb9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 7587295..cb49a25 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1640,21 +1640,16 @@ package body Sem_Aggr is
Set_Etype (Ent, Standard_Void_Type);
Set_Parent (Ent, Parent (N));
Push_Scope (Ent);
- Id :=
- Make_Defining_Identifier (Loc,
- Chars => Chars (Defining_Identifier (N)));
-- Insert and decorate the index variable in the current scope.
-- The expression has to be analyzed once the index variable is
- -- directly visible. Mark the variable as referenced to prevent
- -- spurious warnings, given that subsequent uses of its name in the
- -- expression will reference the internal (synonym) loop variable.
+ -- directly visible.
+ Id := Defining_Identifier (N);
Enter_Name (Id);
Set_Etype (Id, Index_Typ);
Set_Ekind (Id, E_Variable);
Set_Scope (Id, Ent);
- Set_Referenced (Id);
-- Analyze a copy of the expression, to verify legality. We use
-- a copy because the expression will be analyzed anew when the