diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-07-21 17:47:11 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-05 09:21:04 +0200 |
commit | d983abebfffbfe03de74fb127de290179b715af4 (patch) | |
tree | d1ad50bfa607259b3d93aaa0f6e715dc82e16309 /gcc/ada/par-ch4.adb | |
parent | fc32180d704e59553584ae2a814089c2af1bce09 (diff) | |
download | gcc-d983abebfffbfe03de74fb127de290179b715af4.zip gcc-d983abebfffbfe03de74fb127de290179b715af4.tar.gz gcc-d983abebfffbfe03de74fb127de290179b715af4.tar.bz2 |
[Ada] Fix double identifiers in iterated component association
The iterated_component_association grammar construct appears in Ada RM
in two syntactic forms: with iterator_specification and with
defining_identifier. This is now properly reflected in the GNAT AST,
while previously we had two defining_identifiers regardless of the
syntactic form.
Cleanup related to handling of iterated_component_association in SPARK.
Behavior of the compiler itself should not be affected.
gcc/ada/
* exp_aggr.adb (Two_Pass_Aggregate_Expansion): Expand iterated
component association with an unanalyzed copy of iterated
expression. The previous code worked only because the expanded
loop used both an analyzed copy of the iterator_specification and
an analyzed copy of the iterated expression. Now the iterated
expression is reanalyzed in the context of the expanded loop.
* par-ch4.adb (Build_Iterated_Component_Association): Don't set
defining identifier when iterator specification is present.
* sem_aggr.adb (Resolve_Iterated_Association): Pick index name
from the iterator specification.
* sem_elab.adb (Traverse_Potential_Scenario): Handle iterated
element association just like iterated component association. Not
strictly part of this fix, but still worth for the completeness.
* sem_res.adb (Resolve): Pick index name from the iterator
specification, when present.
* sem_util.adb (Traverse_More): For completeness, just like the
change in Traverse_Potential_Scenario.
* sinfo.ads
(ITERATED_COMPONENT_ASSOCIATION): Fix and complete description.
(ITERATED_ELEMENT_ASSOCIATION): Likewise.
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r-- | gcc/ada/par-ch4.adb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 4ab4dcb..9a00d7b 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -3554,7 +3554,6 @@ package body Ch4 is when Tok_Of => Restore_Scan_State (State); Scan; -- past OF - Set_Defining_Identifier (Assoc_Node, Id); Iter_Spec := P_Iterator_Specification (Id); Set_Iterator_Specification (Assoc_Node, Iter_Spec); |