diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2003-01-13 04:16:06 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-01-13 04:16:06 -0500 |
commit | 970684896db235090c080b8ce6cba320d8dfbb5f (patch) | |
tree | 61e18b99d9d12795a0fccefba8a59bbedb6ee9e0 /gcc | |
parent | e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae (diff) | |
download | gcc-970684896db235090c080b8ce6cba320d8dfbb5f.zip gcc-970684896db235090c080b8ce6cba320d8dfbb5f.tar.gz gcc-970684896db235090c080b8ce6cba320d8dfbb5f.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/overload/ambig2.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/overload/ambig2.C b/gcc/testsuite/g++.dg/overload/ambig2.C new file mode 100644 index 0000000..614166f --- /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); } |