]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ada/15808 (Illegal program not detected, RM 3.9.3(10))
authorSamuel Tardieu <sam@rfc1149.net>
Mon, 18 Aug 2008 08:58:58 +0000 (08:58 +0000)
committerSamuel Tardieu <sam@gcc.gnu.org>
Mon, 18 Aug 2008 08:58:58 +0000 (08:58 +0000)
    gcc/ada/
PR ada/15808
* sem_ch6.adb (Check_Private_Overriding): Check for generic packages
as well.

    gcc/testsuite/
PR ada/15808
* gnat.dg/specs/abstract_private.ads: New.

From-SVN: r139190

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/abstract_private.ads [new file with mode: 0644]

index 8aa238fc285a81248acea73ef9408394b48b2218..3ffa6515614e9d458527c002fa83e70bae7b713b 100644 (file)
@@ -1,3 +1,9 @@
+2008-08-18  Samuel Tardieu  <sam@rfc1149.net>
+
+       PR ada/15808
+       * sem_ch6.adb (Check_Private_Overriding): Check for generic packages
+       as well.
+
 2008-08-17  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
 
        * adaint.c (_gnat_set_close_on_exec) [_WIN32]: Implement.
index 1e84b266745f48f711311f0ae6d204d2a784c5f7..d3faa0e420548fbdb84672ac60cd1866c8d4e4f5 100644 (file)
@@ -6481,7 +6481,7 @@ package body Sem_Ch6 is
 
          procedure Check_Private_Overriding (T : Entity_Id) is
          begin
-            if Ekind (Current_Scope) = E_Package
+            if Is_Package_Or_Generic_Package (Current_Scope)
               and then In_Private_Part (Current_Scope)
               and then Visible_Part_Type (T)
               and then not In_Instance
index bd294ade16578e0f3341010e7e2c48ddcbd3d901..9eca6a00edbd75957d8afffdfe880e2f74b86366 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-18  Samuel Tardieu  <sam@rfc1149.net>
+
+       PR ada/15808
+       * gnat.dg/specs/abstract_private.ads: New.
+
 2008-08-18  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/fold-alloca-1.c: Scan cfg dump instead of cleanup_cfg1.
diff --git a/gcc/testsuite/gnat.dg/specs/abstract_private.ads b/gcc/testsuite/gnat.dg/specs/abstract_private.ads
new file mode 100644 (file)
index 0000000..7420a98
--- /dev/null
@@ -0,0 +1,17 @@
+generic
+package Abstract_Private is
+
+   type T1 is abstract tagged private;
+   procedure P1 (X : T1) is abstract;
+
+   type T2 is abstract tagged private;
+
+private
+
+   type T1 is abstract tagged null record;
+   procedure P2 (X : T1) is abstract; -- { dg-error "must be visible" }
+
+   type T2 is abstract new T1 with null record;
+   procedure P1 (X : T2) is abstract;
+
+end Abstract_Private;