2 // Ambiguous conversion, three candidates:
3 // builtin == (int, int), and the two user-defined operators
4 // Each one requires a user-defined ICS where another uses builtin conversions,
5 // so none is the best viable function.
11 operator int() const {return 2;}
14 bool operator==(const MyInt& a, const int& b) // { dg-message "operator==" } candidate
19 bool operator==(const MyInt& a, const MyInt& b) // { dg-message "operator==" } candidate
21 return (int)a == (int)b;
26 return 3 == MyInt(); // { dg-error "ambiguous" "err" }
27 // { dg-message "operator==" "match candidate text" { target *-*-* } 26 }