-- done top down from above.
if
- -- Internal aggregate (transformed when expanding the parent)
- -- excluding the Container aggregate as these are transformed to
- -- procedure call later.
+ -- Internal aggregates (transformed when expanding the parent),
+ -- excluding container aggregates as these are transformed into
+ -- subprogram calls later.
(Parent_Kind in
N_Component_Association | N_Aggregate | N_Extension_Aggregate
-- STEP 3
-- Delay expansion for nested aggregates: it will be taken care of when
- -- the parent aggregate is expanded.
+ -- the parent aggregate is expanded, excluding container aggregates as
+ -- these are transformed into subprogram calls later.
Parent_Node := Parent (N);
Parent_Kind := Nkind (Parent_Node);
Parent_Kind := Nkind (Parent_Node);
end if;
- if Parent_Kind = N_Aggregate
- or else Parent_Kind = N_Extension_Aggregate
- or else Parent_Kind = N_Component_Association
+ if ((Parent_Kind = N_Component_Association
+ or else Parent_Kind = N_Aggregate
+ or else Parent_Kind = N_Extension_Aggregate)
+ and then not Is_Container_Aggregate (Parent_Node))
or else (Parent_Kind = N_Object_Declaration
and then Needs_Finalization (Typ))
or else (Parent_Kind = N_Assignment_Statement