[Bug c++/32756] New: wrong ambiguous overload error?
mueller at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jul 13 10:31:00 GMT 2007
Hi,
this might be invalid, needs verification. starting with gcc 4.3, the following
testcase is rejected:
=== Cut ===
class QString;
struct QByteArray
{
QByteArray ();
bool operator!= (const QString & s2) const;
};
bool operator!= (const QByteArray & a1, const QByteArray & a2);
struct QString
{
QString ();
QString (const QByteArray & a);
};
QByteArray abbreviation ();
void
fromString ()
{
QByteArray zoneAbbrev;
if (abbreviation () != zoneAbbrev)
{
}
}
=== Cut ===
ambiguity.cc:23: error: ISO C++ says that these are ambiguous, even though the
worst conversion for the first is better than the worst conversion for the
second:
ambiguity.cc:9: note: candidate 1: bool operator!=(const QByteArray&, const
QByteArray&)
ambiguity.cc:6: note: candidate 2: bool QByteArray::operator!=(const QString&)
const
--
Summary: wrong ambiguous overload error?
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mueller at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
More information about the Gcc-bugs
mailing list