PR c++/31419
* call.c (reference_binding): Don't look for user-defined conversions
to the same type.
From-SVN: r128383
2007-09-11 Jason Merrill <jason@redhat.com>
+ PR c++/31419
+ * call.c (reference_binding): Don't look for user-defined conversions
+ to the same type.
+
PR c++/15745
* except.c (prepare_eh_type): Use type_decays_to.
return conv;
}
- else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION))
+ /* [class.conv.fct] A conversion function is never used to convert a
+ (possibly cv-qualified) object to the (possibly cv-qualified) same
+ object type (or a reference to it), to a (possibly cv-qualified) base
+ class of that type (or a reference to it).... */
+ else if (CLASS_TYPE_P (from) && !related_p
+ && !(flags & LOOKUP_NO_CONVERSION))
{
/* [dcl.init.ref]