begin
if not Is_Bit_Packed_Array (Typ) then
-
- -- If the component contains tasks, so does the array type. This may
- -- not be indicated in the array type because the component may have
- -- been a private type at the point of definition. Same if component
- -- type is controlled or contains protected objects.
-
- Propagate_Concurrent_Flags (Base, Comp_Typ);
- Set_Has_Controlled_Component
- (Base, Has_Controlled_Component (Comp_Typ)
- or else Is_Controlled (Comp_Typ));
-
if No (Init_Proc (Base)) then
-- If this is an anonymous array created for a declaration with
Typ : constant Node_Id := Entity (N);
Typ_Decl : constant Node_Id := Parent (Typ);
- Comp : Entity_Id;
- Comp_Typ : Entity_Id;
Predef_List : List_Id;
Wrapper_Decl_List : List_Id;
Check_Stream_Attributes (Typ);
end if;
- -- Update task, protected, and controlled component flags, because some
- -- of the component types may have been private at the point of the
- -- record declaration. Detect anonymous access-to-controlled components.
-
- Comp := First_Component (Typ);
- while Present (Comp) loop
- Comp_Typ := Etype (Comp);
-
- Propagate_Concurrent_Flags (Typ, Comp_Typ);
-
- -- Do not set Has_Controlled_Component on a class-wide equivalent
- -- type. See Make_CW_Equivalent_Type.
-
- if not Is_Class_Wide_Equivalent_Type (Typ)
- and then
- (Has_Controlled_Component (Comp_Typ)
- or else (Chars (Comp) /= Name_uParent
- and then Is_Controlled (Comp_Typ)))
- then
- Set_Has_Controlled_Component (Typ);
- end if;
-
- Next_Component (Comp);
- end loop;
-
-- Handle constructors of untagged CPP_Class types
if not Is_Tagged_Type (Typ) and then Is_CPP_Class (Typ) then
Set_SSO_From_Default (Arr);
- -- Propagate flags for component type
+ -- Propagate flags from component type
+
+ Propagate_Concurrent_Flags (Arr, Ctyp);
if Is_Controlled (Ctyp)
or else Has_Controlled_Component (Ctyp)
Freeze_And_Append (Corresponding_Remote_Type (Rec), N, Result);
end if;
- -- Check for controlled components, unchecked unions, and type
- -- invariants.
+ -- Check for tasks, protected and controlled components, unchecked
+ -- unions, and type invariants.
Comp := First_Component (Rec);
while Present (Comp) loop
+ Propagate_Concurrent_Flags (Rec, Etype (Comp));
-- Do not set Has_Controlled_Component on a class-wide
-- equivalent type. See Make_CW_Equivalent_Type.
elsif Is_Record_Type (Input_Typ) then
Comp := First_Component (Input_Typ);
while Present (Comp) loop
- -- Skip _Parent component like Expand_Freeze_Record_Type
+ -- Skip _Parent component like Record_Type_Definition
if Chars (Comp) /= Name_uParent
and then Needs_Finalization (Etype (Comp))