operands to a binary expression; it doesn't make sense in all
contexts. The right answer would be to see if the user forgot at ().
Fixes <rdar://problem/
9136502>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127740
91177308-0d34-0410-b5e6-
96231b3b80d8
Diag(Loc, diag::err_typecheck_invalid_operands)
<< lex->getType() << rex->getType()
<< lex->getSourceRange() << rex->getSourceRange();
- if (lex->getType() == Context.OverloadTy)
- NoteAllOverloadCandidates(lex);
- if (rex->getType() == Context.OverloadTy)
- NoteAllOverloadCandidates(rex);
return QualType();
}
N::X2 x;
x << 17;
}
+
+namespace rdar9136502 {
+ struct X {
+ int i();
+ int i(int);
+ };
+
+ struct Y {
+ Y &operator<<(int); // expected-note{{candidate function not viable: no overload of 'i' matching 'int' for 1st argument}}
+ };
+
+ void f(X x, Y y) {
+ // FIXME: This diagnostic is non-awesome.
+ y << x.i; // expected-error{{invalid operands to binary expression ('rdar9136502::Y' and '<overloaded function type>')}}
+ }
+}