diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-11 05:16:41 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-11 05:16:41 +0000 |
commit | 10ff50d7d8d616254c4705d86f345c8913b52bcb (patch) | |
tree | d63f425b675928e7d96c96d39378a07b7b1c7282 /clang/test/Sema/exprs.c | |
parent | 5f4b32f9d7378a2b88bdc5a52165ab7e56df312f (diff) | |
download | bcm5719-llvm-10ff50d7d8d616254c4705d86f345c8913b52bcb.tar.gz bcm5719-llvm-10ff50d7d8d616254c4705d86f345c8913b52bcb.zip |
PR11857: When the wrong number of arguments are provided for a function
which expects exactly one argument, include the name of the argument in
the diagnostic text. Patch by Terry Long!
llvm-svn: 156607
Diffstat (limited to 'clang/test/Sema/exprs.c')
-rw-r--r-- | clang/test/Sema/exprs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c index 72cff65f483..8bedd6dd01a 100644 --- a/clang/test/Sema/exprs.c +++ b/clang/test/Sema/exprs.c @@ -162,11 +162,17 @@ void test17(int x) { x = sizeof(x/0); // no warning. } -// PR6501 +// PR6501 & PR11857 void test18_a(int a); // expected-note 2 {{'test18_a' declared here}} +void test18_b(int); // expected-note {{'test18_b' declared here}} +void test18_c(int a, int b); // expected-note {{'test18_c' declared here}} +void test18_d(int a, ...); // expected-note {{'test18_d' 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}} + test18_a(); // expected-error {{too few arguments to function call, argument 'a' was not specified}} + test18_b(); // expected-error {{too few arguments to function call, expected 1, have 0}} + test18_c(b); // expected-error {{too few arguments to function call, expected 2, have 1}} + test18_d(); // expected-error {{too few arguments to function call, at least argument 'a' must be specified}} } // PR7569 |