@@ -6723,6 +6723,11 @@ package body Sem_Ch3 is
Has_Private_Component (Derived_Type));
Conditional_Delay (Derived_Type, Subt);
+ if Is_Access_Subprogram_Type (Derived_Type) then
+ Set_Can_Use_Internal_Rep
+ (Derived_Type, Can_Use_Internal_Rep (Parent_Type));
+ end if;
+
-- Ada 2005 (AI-231): Set the null-exclusion attribute, and verify
-- that it is not redundant.
new file mode 100644
@@ -0,0 +1,20 @@
+-- { dg-do run }
+
+procedure Access9 is
+
+ type A_Type is access procedure;
+
+ type B_Type is new A_Type;
+
+ procedure Invoke (B : B_Type) is
+ begin
+ B.all;
+ end;
+
+ procedure Nested is begin null; end;
+
+ A : A_Type := Nested'Access;
+
+begin
+ Invoke (B_Type (A));
+end;
\ No newline at end of file