function Is_Access_Object_Type (Id : E) return B is
begin
- return Is_Access_Type (Id) and then not Is_Access_Subprogram_Type (Id);
+ return Is_Access_Type (Id)
+ and then Ekind (Directly_Designated_Type (Id)) /= E_Subprogram_Type;
end Is_Access_Object_Type;
function Is_Access_Type (Id : E) return B is
function Is_Access_Subprogram_Type (Id : E) return B is
begin
- return Ekind (Id) in Access_Subprogram_Kind;
+ return Is_Access_Type (Id)
+ and then Ekind (Directly_Designated_Type (Id)) = E_Subprogram_Type;
end Is_Access_Subprogram_Type;
function Is_Aggregate_Type (Id : E) return B is
begin
Set_Basic_Convention (E, Val);
- if Is_Type (E)
- and then Is_Access_Subprogram_Type (Base_Type (E))
+ if Ekind (E) in Access_Subprogram_Kind
and then Has_Foreign_Convention (E)
then
Set_Can_Use_Internal_Rep (E, False);
(Sm (Alignment, Uint),
Sm (Associated_Node_For_Itype, Node_Id),
Sm (Can_Use_Internal_Rep, Flag, Base_Type_Only,
- Pre => "Is_Access_Subprogram_Type (Base_Type (N))"),
+ Pre => "Ekind (Base_Type (N)) in Access_Subprogram_Kind"),
Sm (Class_Wide_Type, Node_Id),
Sm (Contract, Node_Id),
Sm (Current_Use_Clause, Node_Id),
else
pragma Assert (Error_Posted (T));
+ return;
end if;
-- If the designated type is a limited view, we cannot tell if
Has_Private_Component (Derived_Type));
Conditional_Delay (Derived_Type, Subt);
- if Is_Access_Subprogram_Type (Derived_Type) then
+ if Is_Access_Subprogram_Type (Derived_Type)
+ and then Is_Base_Type (Derived_Type)
+ then
Set_Can_Use_Internal_Rep
(Derived_Type, Can_Use_Internal_Rep (Parent_Type));
end if;