diff options
author | Gary Dismukes <dismukes@adacore.com> | 2023-11-07 22:16:31 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-11-28 10:35:47 +0100 |
commit | 8ba9430bc41fcf60de936746ebfa27928bcdabc3 (patch) | |
tree | 45f7ba4167b4514cb50b6d788dbe442f4c401a34 /gcc/tree.cc | |
parent | e95a42ec9a6be3edb6d8e31273ffcf64a40c0d3d (diff) | |
download | gcc-8ba9430bc41fcf60de936746ebfa27928bcdabc3.zip gcc-8ba9430bc41fcf60de936746ebfa27928bcdabc3.tar.gz gcc-8ba9430bc41fcf60de936746ebfa27928bcdabc3.tar.bz2 |
ada: Type error on container aggregate with loop_parameter_specification
The compiler incorrectly reported a type error on a container aggregate
for a Vector type with a loop_parameter_specification specifying a
nonstatic upper bound, complaining that it expected the Vector index
type, but instead found type Count_Type. The expansion of the aggregate
was incorrectly passing a size temporary of type Count_Type to the
function associated with the New_Indexed part of the container type's
Aggregate aspect (New_Vector in the case of Vectors), which has two
formals of the container index type. The fix is to convert the size
temporary to the expected index type.
gcc/ada/
* exp_aggr.adb (Expand_Container_Aggregate): Apply a conversion to the
size temp object passed as the second actual parameter on the call to
the New_Indexed_Subp function, to convert it to the index type of the
container type (taken from the first formal parameter of the function).
Diffstat (limited to 'gcc/tree.cc')
0 files changed, 0 insertions, 0 deletions