Commit 4c12c8ea by Jason Merrill Committed by Jason Merrill

re PR c++/34111 (new overload resolution error)

        PR c++/34111
        * call.c (standard_conversion): Derived-to-base is considered a
        standard conversion.

From-SVN: r131107
parent ef833d3d
2007-12-20 Jason Merrill <jason@redhat.com>
PR c++/34111
* call.c (standard_conversion): Derived-to-base is considered a
standard conversion.
2007-12-19 Jakub Jelinek <jakub@redhat.com>
PR c++/34513
......
......@@ -861,14 +861,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
&& vector_types_convertible_p (from, to, false))
return build_conv (ck_std, to, conv);
/* A derived-to-base conversion sequence is a user-defined conversion
because it involves a constructor call, even though it has the rank of
a standard conversion, so we don't consider it if we aren't allowing
user-defined conversions. But if we're binding directly to a
reference, it's only a pointer conversion. */
else if ((!(flags & LOOKUP_NO_CONVERSION)
|| (flags & LOOKUP_NO_TEMP_BIND))
&& IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
&& is_properly_derived_from (from, to))
{
if (conv->kind == ck_rvalue)
......
// PR c++/34111
class QChar
{
};
struct QString
{
QString(QChar);
};
struct QPainter
{
void drawText (int x, int y, const QString &);
};
class KHEChar:public QChar
{
public:KHEChar (QChar C);
};
void
drawByte (QPainter * P, char, KHEChar B)
{
P->drawText (0, 0, B);
}
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