This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32756] New: wrong ambiguous overload error?
- From: "mueller at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2007 10:31:29 -0000
- Subject: [Bug c++/32756] New: wrong ambiguous overload error?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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