2016-07-18 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71835
+ * call.c (build_op_call_1): Use convert_like_with_context only
+ if cand->fn is a decl.
+
PR c++/71828
* constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
For lval don't use cxx_eval_unary_expression and instead recurse
result = build_over_call (cand, LOOKUP_NORMAL, complain);
else
{
- obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1,
- complain);
+ if (DECL_P (cand->fn))
+ obj = convert_like_with_context (cand->convs[0], obj, cand->fn,
+ -1, complain);
+ else
+ obj = convert_like (cand->convs[0], obj, complain);
obj = convert_from_reference (obj);
result = cp_build_function_call_vec (obj, args, complain);
}
--- /dev/null
+// PR c++/71835
+// { dg-do compile }
+
+typedef void T (int);
+struct A { operator T * (); }; // { dg-message "candidate" }
+struct B { operator T * (); }; // { dg-message "candidate" }
+struct C : A, B {} c;
+
+void
+foo ()
+{
+ c (0); // { dg-error "is ambiguous" }
+}