Ada compiler fixes array aggregate assignment to unconstrained formal parameters.
Ada compiler regression fixed for sliding array aggregates assigned to unconstrained formal parameters.
A regression in the Ada compiler that caused a failure when assigning an array aggregate to an unconstrained formal parameter has been fixed. The compiler previously failed to implement the necessary ‘sliding’ due to an incorrect predicate that only considered object declarations. This update ensures correct handling of such assignments across multiple GCC branches.
In Details
The Ada compiler's exp_aggr.adb file has been updated to correct a regression in handling assignments of array aggregates to unconstrained formal parameters. The Must_Slide predicate was reordered and modified to accept an Assign boolean parameter. This allows it to correctly determine the need for sliding when an aggregate is assigned to a formal parameter, rather than only considering object declarations where the subtype is unconstrained.
- array aggregate
- In Ada, a way to specify the values of an array type, either by listing elements with their indices or by providing a sequence of values.
- unconstrained formal parameter
- In Ada, a function or procedure parameter whose type (e.g., array or record) does not have a fixed size or bounds defined at compile time. Its size is determined by the actual argument passed during the call.
- sliding
- A mechanism in Ada related to type conversions and assignments, particularly for array types, where the bounds of the source are adapted to match the bounds of the target. This is essential for assignments between arrays of different but compatible sizes.