===================================================================
@@ -1384,7 +1384,11 @@
end if;
if Has_Invariants (E) then
- Build_Invariant_Procedure (E, N);
+ if Ekind (E) = E_Private_Subtype then
+ null;
+ else
+ Build_Invariant_Procedure (E, N);
+ end if;
end if;
end if;
===================================================================
@@ -3903,6 +3903,7 @@
if Ctrl = Ent
or else Ctrl = Class_Wide_Type (Ent)
+
or else
(Ekind (Ctrl) = E_Anonymous_Access_Type
and then
@@ -7393,6 +7394,7 @@
Chars => New_External_Name (Chars (Typ), "Invariant"));
Set_Has_Invariants (Typ);
Set_Ekind (SId, E_Procedure);
+ Set_Etype (SId, Standard_Void_Type);
Set_Is_Invariant_Procedure (SId);
Set_Invariant_Procedure (Typ, SId);
===================================================================
@@ -3720,10 +3720,12 @@
end if;
end if;
+ -- The aspect is type-specific, so retrieve it from the base type.
+
Call :=
Make_Procedure_Call_Statement (Loc,
Name =>
- New_Occurrence_Of (Invariant_Procedure (Typ), Loc),
+ New_Occurrence_Of (Invariant_Procedure (Base_Type (Typ)), Loc),
Parameter_Associations => New_List (Sel_Comp));
if Is_Access_Type (Etype (Comp)) then