diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-11-24 10:40:16 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-11-24 10:40:16 +0000 |
commit | 89e30d8e06052775181f7042c139a2a1fbb1a2ad (patch) | |
tree | d71b5c1314fa42547e06fc0b88f93a7a018827f2 /gcc/cp/decl.c | |
parent | 9bae6b1a742961657ac556acba6cc41dc6d8763c (diff) |
PR c++/8929
* decl.c (start_decl): Check for invalid specialization headers.
PR c++/8929
* g++.old-deja/g++.oliva/template10.C: Remove xfail.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@91145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9baedb42d32..bca328846e5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 |