summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/overload/ambig2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/overload/ambig2.C')
-rw-r--r--gcc/testsuite/g++.dg/overload/ambig2.C22
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 000000000..614166f9f
--- /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); }