diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-01-11 08:50:29 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-01-11 08:50:29 +0000 |
commit | d940c627e077379a534d69025f6a962f8caf4b39 (patch) | |
tree | 918addcf9e103d9da9f9437a5827c6ceeb124292 /gcc/ada/sinfo.adb | |
parent | c8f258171c90b52a45c6884138df740b2ef88c27 (diff) | |
download | gcc-d940c627e077379a534d69025f6a962f8caf4b39.zip gcc-d940c627e077379a534d69025f6a962f8caf4b39.tar.gz gcc-d940c627e077379a534d69025f6a962f8caf4b39.tar.bz2 |
[Ada] Crash on iterated_component_association in expression function
This patch improves on the handling of the Ada2020 construct Iterated_
Component_Association in various contexts, when the expression involved
is a record or array aggregate.
Executing:
gnatmake -gnatX -q main
./main
must yield:
123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
----
with Text_IO; use Text_IO;
with Exfor; use Exfor;
procedure Main is
Map : String := Table_ASCII;
begin
Put_Line (Map (50..91));
end;
----
package Exfor is
function Table_ASCII return String is
(for I in 1 .. Character'Pos (Character'Last) + 1 => Character'Val(I-1));
end Exfor;
2018-01-11 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_aggr.adb (Resolve_Iterated_Component_Association): Perform
analysis on a copy of the expression with a copy of the index variable,
because full expansion will rewrite construct into a loop with the
original loop variable.
* exp_aggr.adb (Gen_Assign): Defer analysis and resolution if the
expression is an iterated component association. Full analysis takes
place when construct is rewritten as a loop.
(In_Place_Assign_OK, Safe_Component): An iterated_component_association
is not safe for in-place assignment.
* sem_util.adb (Remove_Entity): Handle properly the case of an isolated
entity with no homonym and no other entity in the scope.
From-SVN: r256485
Diffstat (limited to 'gcc/ada/sinfo.adb')
0 files changed, 0 insertions, 0 deletions