The attached test case has 2 code branches (#ifdef BREAKME and #ifndef BREAKME) that are treated as identical in all prior gcc versions.
4.3 snapshots barf with: gcc-4.3-testcase.cpp: In function 'int main()': gcc-4.3-testcase.cpp:28: 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: gcc-4.3-testcase.cpp:14: note: candidate 1: bool operator==(const junk&, const char*) gcc-4.3-testcase.cpp:7: note: candidate 2: bool junk::operator==(const foo&) const since even in the BREAKME version, no implicit casting is involved, I tend to think older gcc versions are right. -- Summary: Recent gcc 4.3 snapshots think comparison operators are ambiguous Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bero at arklinux dot org GCC build triplet: i586-pc-linux-gnu GCC host triplet: i586-pc-linux-gnu GCC target triplet: i586-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33378