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

Reply via email to