def err_typecheck_call_too_many_args : Error<
"too many arguments to %select{function|block|method}0 call, "
"expected %1, have %2">;
+def note_typecheck_call_too_many_args : Note<
+ "%0 declared here">;
def err_typecheck_call_too_many_args_at_most : Error<
"too many arguments to %select{function|block|method}0 call, "
"expected at most %1, have %2">;
<< NumArgsInProto << NumArgs << Fn->getSourceRange()
<< SourceRange(Args[NumArgsInProto]->getLocStart(),
Args[NumArgs-1]->getLocEnd());
+
+ // Emit the location of the prototype.
+ if (FDecl && !FDecl->getBuiltinID())
+ Diag(FDecl->getLocStart(),
+ diag::note_typecheck_call_too_many_args)
+ << FDecl;
+
// This deletes the extra arguments.
Call->setNumArgs(Context, NumArgsInProto);
return true;
struct Y : N::X { };
}
-void f();
+void f(); // expected-note 2 {{'f' declared here}}
void test_operator_adl(N::X x, M::Y y) {
(void)(x + x);
}
// PR6501
-void test18_a(int a);
+void test18_a(int a); // expected-note {{'test18_a' declared here}}
void test18(int b) {
test18_a(b, b); // expected-error {{too many arguments to function call, expected 1, have 2}}
test18_a(); // expected-error {{too few arguments to function call, expected 1, have 0}}
// PR3588
void g0(int, int);
-void g0(); // expected-note{{previous declaration is here}}
+void g0(); // expected-note{{previous declaration is here}} expected-note{{'g0' declared here}}
void f0() {
g0(1, 2, 3); // expected-error{{too many arguments to function call}}