OSDN Git Service

PR c++/8929
authorgiovannibajo <giovannibajo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 Nov 2004 10:40:16 +0000 (10:40 +0000)
committergiovannibajo <giovannibajo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 Nov 2004 10:40:16 +0000 (10:40 +0000)
* decl.c (start_decl): Check for invalid specialization headers.

PR c++/8929
* g++.old-deja/g++.oliva/template10.C: Remove xfail.

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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/template10.C

index 4f9c1d8..8797df9 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/8929
+       * decl.c (start_decl): Check for invalid specialization headers.
+
 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
 
        PR c++/16882
index 9baedb4..bca3288 100644 (file)
@@ -3776,6 +3776,11 @@ start_decl (const cp_declarator *declarator,
                             context, DECL_NAME (decl));
                  DECL_CONTEXT (decl) = DECL_CONTEXT (field);
                }
+             if (processing_specialization
+                 && template_class_depth (context) == 0
+                 && CLASSTYPE_TEMPLATE_SPECIALIZATION (context))
+               error ("template header not allowed in member definition "
+                      "of explicitly specialized class");
              /* Static data member are tricky; an in-class initialization
                 still doesn't provide a definition, so the in-class
                 declaration will have DECL_EXTERNAL set, but will have an
index 8edf27c..6a98976 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/8929
+       * g++.old-deja/g++.oliva/template10.C: Remove xfail.
+
 2004-11-24  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.target/sparc/align.c: Do not include <stdint.h>.
index 6991bf9..5c1204b 100644 (file)
@@ -19,4 +19,4 @@ template<> struct A<int> {
 };
 
 bool A<int>::a = true; // ok
-template<> bool A<int>::b = false; // { dg-error "" "" { xfail *-*-* } } 
+template<> bool A<int>::b = false; // { dg-error "template header" }