-- private type, making some components invisible and aggregates illegal.
-- This flag is set at the point of derivation. The legality of the
-- aggregate must be rechecked because it also depends on the visibility
--- at the point the aggregate is resolved. See sem_aggr.adb.
--- This is part of AI05-0115.
+-- at the point the aggregate is resolved. See sem_aggr.adb. This is part
+-- of AI05-0115.
-- Has_Private_Declaration (Flag155)
-- Defined in all entities. Set if it is the defining entity of a private
Full_Parent := Full_View (Full_Parent);
end if;
+ -- And its underlying full view if necessary
+
+ if Is_Private_Type (Full_Parent)
+ and then Present (Underlying_Full_View (Full_Parent))
+ then
+ Full_Parent := Underlying_Full_View (Full_Parent);
+ end if;
+
if Ekind (Full_Parent) in Record_Kind
or else
(Ekind (Full_Parent) in Enumeration_Kind
-- view, the completion does not derive them anew.
if Ekind (Full_Parent) in Record_Kind then
+
-- If parent type is tagged, the completion inherits the proper
-- primitive operations.
if Is_Tagged_Type (Parent_Type) then
- Build_Derived_Record_Type (
- Full_N, Full_Parent, Full_Der, Derive_Subps);
+ Build_Derived_Record_Type
+ (Full_N, Full_Parent, Full_Der, Derive_Subps);
else
- Build_Derived_Record_Type (
- Full_N, Full_Parent, Full_Der, Derive_Subps => False);
+ Build_Derived_Record_Type
+ (Full_N, Full_Parent, Full_Der, Derive_Subps => False);
end if;
else
else
Full_Der :=
- Make_Defining_Identifier
- (Sloc (Derived_Type), Chars (Derived_Type));
+ Make_Defining_Identifier (Sloc (Derived_Type),
+ Chars => Chars (Derived_Type));
Set_Is_Itype (Full_Der);
Set_Associated_Node_For_Itype (Full_Der, N);
Set_Parent (Full_Der, N);
- Build_Derived_Type (
- N, Full_Parent, Full_Der, True, Derive_Subps => False);
+ Build_Derived_Type
+ (N, Full_Parent, Full_Der, True, Derive_Subps => False);
end if;
Set_Has_Private_Declaration (Full_Der);
Related_Nod : Node_Id)
is
Id_B : constant Entity_Id := Base_Type (Id);
- Full_B : constant Entity_Id := Full_View (Id_B);
+ Full_B : Entity_Id := Full_View (Id_B);
Full : Entity_Id;
begin
if Present (Full_B) then
+ -- Get to the underlying full view if necessary
+
+ if Is_Private_Type (Full_B)
+ and then Present (Underlying_Full_View (Full_B))
+ then
+ Full_B := Underlying_Full_View (Full_B);
+ end if;
+
-- The Base_Type is already completed, we can complete the subtype
-- now. We have to create a new entity with the same name, Thus we
-- can't use Create_Itype.