OSDN Git Service

gcc/ada/
authorsam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Aug 2008 08:58:58 +0000 (08:58 +0000)
committersam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Aug 2008 08:58:58 +0000 (08:58 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139190 138bc75d-0d04-0410-961f-82ee72b054a4

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 8aa238f..3ffa651 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 1e84b26..d3faa0e 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 bd294ad..9eca6a0 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;