diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/blocks.m | 9 | ||||
-rw-r--r-- | clang/test/Analysis/inline.c | 2 | ||||
-rw-r--r-- | clang/test/Analysis/inline.cpp | 2 | ||||
-rw-r--r-- | clang/test/Analysis/nullability.c | 6 |
4 files changed, 14 insertions, 5 deletions
diff --git a/clang/test/Analysis/blocks.m b/clang/test/Analysis/blocks.m index 0b1c15abb3b..bf10c61d3a2 100644 --- a/clang/test/Analysis/blocks.m +++ b/clang/test/Analysis/blocks.m @@ -232,3 +232,12 @@ __attribute__((objc_root_class)) }); } @end + +// The incorrect block variable initialization below is a hard compile-time +// error in C++. +#if !defined(__cplusplus) +void call_block_with_fewer_arguments() { + void (^b)() = ^(int a) { }; + b(); // expected-warning {{Block taking 1 argument is called with fewer (0)}} +} +#endif diff --git a/clang/test/Analysis/inline.c b/clang/test/Analysis/inline.c index 9ecdce33a36..03c4ea83258 100644 --- a/clang/test/Analysis/inline.c +++ b/clang/test/Analysis/inline.c @@ -114,5 +114,5 @@ void never_called_by_anyone() { void knr_one_argument(a) int a; { } void call_with_less_arguments() { - knr_one_argument(); // expected-warning{{too few arguments}} expected-warning{{Function taking 1 argument}} + knr_one_argument(); // expected-warning{{too few arguments}} expected-warning{{Function taking 1 argument is called with fewer (0)}} } diff --git a/clang/test/Analysis/inline.cpp b/clang/test/Analysis/inline.cpp index b7962b53a89..9fc4f81c05b 100644 --- a/clang/test/Analysis/inline.cpp +++ b/clang/test/Analysis/inline.cpp @@ -441,6 +441,6 @@ namespace rdar12409977 { namespace bug16307 { void one_argument(int a) { } void call_with_less() { - reinterpret_cast<void (*)()>(one_argument)(); // expected-warning{{Function taking 1 argument}} + reinterpret_cast<void (*)()>(one_argument)(); // expected-warning{{Function taking 1 argument is called with fewer (0)}} } } diff --git a/clang/test/Analysis/nullability.c b/clang/test/Analysis/nullability.c index e16587901ce..a282969e03d 100644 --- a/clang/test/Analysis/nullability.c +++ b/clang/test/Analysis/nullability.c @@ -3,10 +3,10 @@ void it_takes_two(int a, int b); void function_pointer_arity_mismatch() { void(*fptr)() = it_takes_two; - fptr(1); // no-crash expected-warning {{Function taking 2 arguments is called with less (1)}} + fptr(1); // no-crash expected-warning {{Function taking 2 arguments is called with fewer (1)}} } void block_arity_mismatch() { - void(^b)() = ^(int a, int b) { }; // no-crash - b(1); + void(^b)() = ^(int a, int b) { }; + b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}} } |