2011-02-20 Jason Merrill <jason@redhat.com>
+ PR c++/46831
+ * call.c (convert_class_to_reference): Don't try to set up a
+ second conv sequence for non-viable candidates.
+
PR c++/47703
* error.c (location_of): Handle non-tagged types.
rvalue of the right type is good enough. */
tree f = cand->fn;
tree t2 = TREE_TYPE (TREE_TYPE (f));
- if (TREE_CODE (t2) != REFERENCE_TYPE
- || !reference_compatible_p (t, TREE_TYPE (t2)))
+ if (cand->viable == 0)
+ /* Don't bother looking more closely. */;
+ else if (TREE_CODE (t2) != REFERENCE_TYPE
+ || !reference_compatible_p (t, TREE_TYPE (t2)))
{
/* No need to set cand->reason here; this is most likely
an ambiguous match. If it's not, either this candidate
2011-02-20 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/fntmpdefarg2.C: New.
+
* g++.dg/overload/conv-op1.C: New.
* g++.dg/cpp0x/constexpr-synth1.C: New.