def err_ovl_candidate_deleted : Note<
"candidate function has been explicitly %select{made unavailable|deleted}0">;
def err_ovl_builtin_binary_candidate : Note<
- "built-in candidate operator %0 (%1, %2)">;
+ "built-in candidate %0">;
def err_ovl_builtin_unary_candidate : Note<
- "built-in candidate operator %0 (%1)">;
+ "built-in candidate %0">;
def err_ovl_no_viable_function_in_init : Error<
"no matching constructor for initialization of %0">;
def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
} else if (OnlyViable) {
assert(Cand->Conversions.size() <= 2 &&
"builtin-binary-operator-not-binary");
- if (Cand->Conversions.size() == 1)
- Diag(OpLoc, diag::err_ovl_builtin_unary_candidate)
- << Opc << Cand->BuiltinTypes.ParamTypes[0];
- else
- Diag(OpLoc, diag::err_ovl_builtin_binary_candidate)
- << Opc << Cand->BuiltinTypes.ParamTypes[0]
- << Cand->BuiltinTypes.ParamTypes[1];
+ std::string TypeStr("operator");
+ TypeStr += Opc;
+ TypeStr += "(";
+ TypeStr += Cand->BuiltinTypes.ParamTypes[0].getAsString();
+ if (Cand->Conversions.size() == 1) {
+ TypeStr += ")";
+ Diag(OpLoc, diag::err_ovl_builtin_unary_candidate) << TypeStr;
+ }
+ else {
+ TypeStr += ", ";
+ TypeStr += Cand->BuiltinTypes.ParamTypes[1].getAsString();
+ TypeStr += ")";
+ Diag(OpLoc, diag::err_ovl_builtin_binary_candidate) << TypeStr;
+ }
}
else if (!Cand->Viable && !Reported) {
// Non-viability might be due to ambiguous user-defined conversions,
void test(C c) {
++c; // expected-error {{use of overloaded operator '++' is ambiguous}}\
- // expected-note {{built-in candidate operator ++ ('int &')}} \
- // expected-note {{built-in candidate operator ++ ('long &')}} \
- // expected-note {{built-in candidate operator ++ ('long *&')}} \
- // expected-note {{built-in candidate operator ++ ('int *&')}}
+ // expected-note {{built-in candidate operator++(int &)}} \
+ // expected-note {{built-in candidate operator++(long &)}} \
+ // expected-note {{built-in candidate operator++(long *&)}} \
+ // expected-note {{built-in candidate operator++(int *&)}}
}
struct A1 { operator volatile int&(); };
void test(C1 c) {
++c; // expected-error {{use of overloaded operator '++' is ambiguous}} \
- // expected-note {{built-in candidate operator ++ ('int volatile &')}} \
- // expected-note {{built-in candidate operator ++ ('long volatile &')}}
+ // expected-note {{built-in candidate operator++(int volatile &)}} \
+ // expected-note {{built-in candidate operator++(long volatile &)}}
}
void foo(C c, int A::* pmf) {
// FIXME. Why so many built-in candidates?
int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
- // expected-note {{built-in candidate operator ->* ('struct A const *', 'int const struct A::*')}} \
- // expected-note {{built-in candidate operator ->* ('struct A const *', 'int struct A::*')}} \
- // expected-note {{built-in candidate operator ->* ('struct A *', 'int const struct A::*')}} \
- // expected-note {{built-in candidate operator ->* ('struct A *', 'int struct A::*')}}
+ // expected-note {{built-in candidate operator->*(struct A const *, int const struct A::*)}} \
+ // expected-note {{built-in candidate operator->*(struct A const *, int struct A::*)}} \
+ // expected-note {{built-in candidate operator->*(struct A *, int const struct A::*)}} \
+ // expected-note {{built-in candidate operator->*(struct A *, int struct A::*)}}
}