mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 18:20:51 +08:00
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:
parent
592590f532
commit
9114616933
@ -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
|
||||
|
@ -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
|
||||
|
@ -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>.
|
||||
|
@ -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" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user