re PR c++/41994 (ICE with &A::operator T)

PR c++/41994
	* pt.c (tsubst_baselink): tsubst the name.

From-SVN: r154041
This commit is contained in:
Jason Merrill 2009-11-09 13:32:44 -05:00 committed by Jason Merrill
parent 8b0c13a824
commit ff14c1f700
4 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2009-11-09 Jason Merrill <jason@redhat.com>
PR c++/41994
* pt.c (tsubst_baselink): tsubst the name.
2009-11-07 Jason Merrill <jason@redhat.com>
PR c++/37920

View file

@ -10318,7 +10318,7 @@ tsubst_baselink (tree baselink, tree object_type,
qualifying_scope = tsubst (qualifying_scope, args,
complain, in_decl);
fns = BASELINK_FUNCTIONS (baselink);
optype = BASELINK_OPTYPE (baselink);
optype = tsubst (BASELINK_OPTYPE (baselink), args, complain, in_decl);
if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
{
template_id_p = true;
@ -10329,6 +10329,8 @@ tsubst_baselink (tree baselink, tree object_type,
complain, in_decl);
}
name = DECL_NAME (get_first_fn (fns));
if (IDENTIFIER_TYPENAME_P (name))
name = mangle_conv_op_name_for_type (optype);
baselink = lookup_fnfields (qualifying_scope, name, /*protect=*/1);
/* If lookup found a single function, mark it as used at this
@ -10347,8 +10349,7 @@ tsubst_baselink (tree baselink, tree object_type,
BASELINK_FUNCTIONS (baselink),
template_args);
/* Update the conversion operator type. */
BASELINK_OPTYPE (baselink)
= tsubst (optype, args, complain, in_decl);
BASELINK_OPTYPE (baselink) = optype;
if (!object_type)
object_type = current_class_type;

View file

@ -1,3 +1,8 @@
2009-11-09 Jason Merrill <jason@redhat.com>
PR c++/41994
* g++.dg/template/conv10.C: New.
2009-11-07 Jason Merrill <jason@redhat.com>
PR c++/37920

View file

@ -0,0 +1,9 @@
// PR c++/41994
template<typename T> struct A
{
operator T();
A() { T (A::*f)() = &A::operator T; }
};
A<int> a;