Commit 4a5d353f by Jason Merrill Committed by Jason Merrill

re PR c++/41468 (SFINAE for expressions doesn't consider ambiguous conversion sequences)

	PR c++/41468
	* call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
	if we don't want errors.

From-SVN: r158799
parent 798ec807
2010-04-27 Jason Merrill <jason@redhat.com>
PR c++/41468
* call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
if we don't want errors.
PR c++/41468
* class.c (convert_to_base): Add complain parameter. Pass
ba_quiet to lookup_base if we don't want errors.
(build_vfield_ref): Pass complain to convert_to_base.
......
......@@ -4947,6 +4947,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
}
return expr;
case ck_ambig:
if (!(complain & tf_error))
return error_mark_node;
/* Call build_user_type_conversion again for the error. */
return build_user_type_conversion
(totype, convs->u.expr, LOOKUP_NORMAL);
......
......@@ -2,6 +2,7 @@
PR c++/41468
* g++.dg/template/sfinae17.C: New.
* g++.dg/template/sfinae18.C: New.
2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
......
// PR c++/41468
typedef int Ft(int);
struct A { operator Ft*(); };
struct B { operator Ft*(); };
struct C : A, B { };
template<typename C> void f(int (*a)[sizeof(C()(0))]);
template<typename C> void f(...);
int main() { f<C>(0); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment