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:
parent
8b0c13a824
commit
ff14c1f700
4 changed files with 23 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
9
gcc/testsuite/g++.dg/template/conv10.C
Normal file
9
gcc/testsuite/g++.dg/template/conv10.C
Normal 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;
|
Loading…
Add table
Reference in a new issue