diff options
author | Mark Mitchell <mark@codesourcery.com> | 2006-12-06 05:12:46 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2006-12-06 05:12:46 +0000 |
commit | 7f1ba716a2b0eb2db5e641f739bf461912e7ef89 (patch) | |
tree | 8687d2f642a0080d050842e20ef8361d9010c77b /gcc/cp/decl2.c | |
parent | f75709c6f83fbf654b8bc283f27ddd8d4f894227 (diff) | |
download | gcc-7f1ba716a2b0eb2db5e641f739bf461912e7ef89.tar.gz |
re PR c++/29729 (ICE with template class in template function)
PR c++/29729
* decl2.c (check_member_template): Move check for member
templates in local classes to ...
* parser.c (cp_parser_template_declaration_after_export):
... here.
PR c++/29729
* g++.dg/template/crash63.C: New test.
From-SVN: r119575
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 43889181f2f..b2a97ff9dc2 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -445,13 +445,8 @@ check_member_template (tree tmpl) || (TREE_CODE (decl) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (decl)))) { - if (current_function_decl) - /* 14.5.2.2 [temp.mem] - - A local class shall not have member templates. */ - error ("invalid declaration of member template %q#D in local class", - decl); - + /* The parser rejects template declarations in local classes. */ + gcc_assert (!current_function_decl); /* The parser rejects any use of virtual in a function template. */ gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))); |