summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/overload/ambig2.C
blob: 614166f9fe8390f5fba284084c0afa38f59a8646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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); }