From: Jason Merrill Date: Mon, 13 Jan 2003 09:16:06 +0000 (-0500) Subject: call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if all the ambiguous conve... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=970684896db235090c080b8ce6cba320d8dfbb5f;p=gcc.git call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if all the ambiguous conversions are bad. * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if all the ambiguous conversions are bad. From-SVN: r61249 --- diff --git a/gcc/testsuite/g++.dg/overload/ambig2.C b/gcc/testsuite/g++.dg/overload/ambig2.C new file mode 100644 index 00000000000..614166f9fe8 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/ambig2.C @@ -0,0 +1,22 @@ +// Bug: g++ thought that the QChar overload was a viable but ambiguous +// candidate. It isn't viable, because there's no conversion from const +// char * to QChar. + +class QChar { +public: + QChar( char c ); + QChar( unsigned char c ); +}; + +class QString +{ +public: + QString( const char *str ); // deep copy + + QString &insert( unsigned int index, const QString & ); + QString &insert( unsigned int index, QChar ); + QString &prepend( const char* ); +}; + +inline QString &QString::prepend( const char* s ) +{ return insert(0,s); }