Commit 7e2fbe93 by Robert Lipe

Corrections, per Martin.

From-SVN: r20189
parent 72f8240e
// Build don't link: // Ambiguous conversion, three candidates:
// XFAIL, doesn't. // builtin == (int, int), and the two user-defined operators
// Each one requires a user-defined ICS where another uses builtin conversions,
// so none is the best viable function.
class MyInt class MyInt
{ {
...@@ -9,16 +11,16 @@ public: ...@@ -9,16 +11,16 @@ public:
}; };
bool operator==(const MyInt& a, const int& b) bool operator==(const MyInt& a, const int& b)
{ { // ERROR - candidate
return (int)a == b; return (int)a == b;
} }
bool operator==(const MyInt& a, const MyInt& b) bool operator==(const MyInt& a, const MyInt& b)
{ { // ERROR - candidate
return (int)a == (int)b; return (int)a == (int)b;
} }
bool f() bool f()
{ {
return 3 == MyInt(); return 3 == MyInt(); // ERROR - ambiguous
} } // ERROR - no return value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment