diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2002-12-22 21:32:28 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-12-22 21:32:28 +0000 |
commit | 081cebb27adaef4511307a2a6d4413fb65be48c7 (patch) | |
tree | cf5e2f1f1a84eaecaddd24a649a00292285af255 /gcc/cp/decl2.c | |
parent | 96e13905ad6eb836fc85bc564f31ee8a055cd07e (diff) | |
download | gcc-081cebb27adaef4511307a2a6d4413fb65be48c7.zip gcc-081cebb27adaef4511307a2a6d4413fb65be48c7.tar.gz gcc-081cebb27adaef4511307a2a6d4413fb65be48c7.tar.bz2 |
re PR c++/8572 (ICE with external definition of conversion operator to internal class within template class)
cp:
PR c++/8572
* cp-tree.h (grokoptypename): Add SCOPE parameter.
* decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
if in a template scope.
* parse.y (unoperator): Return the scope.
(operator_name): Adjust grokoptypename call.
testsuite:
* g++.dg/parse/conv_op1.C: New test.
From-SVN: r60416
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index f33ba8d..d305ee5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1120,11 +1120,29 @@ grokbitfield (declarator, declspecs, width) return value; } +/* Convert a conversion operator name to an identifier. SCOPE is the + scope of the conversion operator, if explicit. */ + tree -grokoptypename (declspecs, declarator) +grokoptypename (declspecs, declarator, scope) tree declspecs, declarator; + tree scope; { tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL); + + /* Resolve any TYPENAME_TYPEs that refer to SCOPE, before mangling + the name, so that we mangle the right thing. */ + if (scope && current_template_parms + && uses_template_parms (t) + && uses_template_parms (scope)) + { + tree args = current_template_args (); + + push_scope (scope); + t = tsubst (t, args, tf_error | tf_warning, NULL_TREE); + pop_scope (scope); + } + return mangle_conv_op_name_for_type (t); } |