re PR c++/8929 (G++ accepts invalid template headers in member definitions of explicitly specialized classes)

PR c++/8929
	* decl.c (start_decl): Check for invalid specialization headers.

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

From-SVN: r91145
This commit is contained in:
Giovanni Bajo 2004-11-24 10:40:16 +00:00
parent 592590f532
commit 9114616933
4 changed files with 16 additions and 1 deletions

View 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

View 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

View 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>.

View 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" }