[Ada] Crash on inherited private operation in child package
[gcc.git] / gcc / ada / sem_ch7.adb
index 313cb4eaaa34cb8ea709010b38ee63a29bf166b1..6d9a1db5b7edb1275c81fa6f14210b7f945efdf2 100644 (file)
@@ -925,9 +925,12 @@ package body Sem_Ch7 is
       --  This is a nested package, so it may be necessary to declare certain
       --  inherited subprograms that are not yet visible because the parent
       --  type's subprograms are now visible.
+      --  Note that for child units these operations were generated when
+      --  analyzing the package specification.
 
       if Ekind (Scope (Spec_Id)) = E_Package
         and then Scope (Spec_Id) /= Standard_Standard
+        and then not Is_Child_Unit (Spec_Id)
       then
          Declare_Inherited_Private_Subprograms (Spec_Id);
       end if;