From ddb45080b4c1eab4c83dccafbc5a50ce70270a4d Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 2 Jul 2003 04:11:30 +0000 Subject: re PR c++/6949 (ICE in tsubst_decl, at cp/pt.c:5733) PR c++/6949 * decl2.c (grokfield): Create TEMPLATE_DECLs for methods in local classes. PR c++/6949 * g++.dg/template/local3.C: New test. From-SVN: r68818 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl2.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a76a82b..c0480b9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-07-01 Mark Mitchell + + PR c++/6949 + * decl2.c (grokfield): Create TEMPLATE_DECLs for methods in local + classes. + 2003-07-01 Kaveh R. Ghazi * error.c (locate_error): %P takes an `int', not a `tree'. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a440c06..c621793 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -970,7 +970,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, } } - if (processing_template_decl && ! current_function_decl + if (processing_template_decl && (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL)) value = push_template_decl (value); -- cgit v1.1