diff options
author | Viljar Indus <indus@adacore.com> | 2023-07-05 12:28:56 +0300 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-18 15:11:47 +0200 |
commit | a6ca70c6744ed6019b1ddbc41c8a09a45331e5bb (patch) | |
tree | 6df74df6e5c847a0af8372a11fc374b4122c4ad6 | |
parent | 086a2c9d042f14397dcde345c5011e20cc6016f4 (diff) | |
download | gcc-a6ca70c6744ed6019b1ddbc41c8a09a45331e5bb.zip gcc-a6ca70c6744ed6019b1ddbc41c8a09a45331e5bb.tar.gz gcc-a6ca70c6744ed6019b1ddbc41c8a09a45331e5bb.tar.bz2 |
ada: Fix expanding container aggregates with Iterator specification
The compiler should use unnamed addition methods such as Append
when expanding a container aggregate with Iterator Specification.
gcc/ada/
* exp_aggr.adb (Expand_Container_Aggregate): Use the positional
addition method only when dealing with a container aggregate
without an Iterator Specification e.g. with a loop parameter
specification
-rw-r--r-- | gcc/ada/exp_aggr.adb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 4c8dcae..dffc5ab 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -7259,8 +7259,11 @@ package body Exp_Aggr is -- Iterated component association. Discard -- positional insertion procedure. - Add_Named_Subp := Assign_Indexed_Subp; - Add_Unnamed_Subp := Empty; + if not Present (Iterator_Specification (Comp)) then + Add_Named_Subp := Assign_Indexed_Subp; + Add_Unnamed_Subp := Empty; + end if; + Expand_Iterated_Component (Comp); end if; |