Commit 91146169 by Giovanni Bajo

re PR c++/8929 (G++ accepts invalid template headers in member definitions of…

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
parent 592590f5
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
......
......@@ -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
......
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>.
......
......@@ -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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment