In the case of controlled components initialized by a container aggregate,
the compiler was suppressing the call to the needed Adjust operation,
because it was suppressed for all aggregates. But container aggregates
aren't built in place, so target adjustment should still be done in that
case.
gcc/ada/
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Do the
component adjustment in the case of initialization by a container
aggregate.
end if;
-- Adjust the component if controlled except if it is an aggregate
- -- that will be expanded inline.
+ -- that will be expanded inline (but note that the case of container
+ -- aggregates does require component adjustment).
if Needs_Finalization (Typ)
- and then Nkind (Exp_Q) not in N_Aggregate | N_Extension_Aggregate
+ and then (Nkind (Exp_Q) not in N_Aggregate | N_Extension_Aggregate
+ or else Is_Container_Aggregate (Exp_Q))
and then not Is_Build_In_Place_Function_Call (Exp)
then
Adj_Call :=