blob: a282969e03d429ecc00f208ef0edb1d4932f1a46 [file] [log] [blame]
Devin Coughline4224cc2016-11-14 22:46:02 +00001// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core,nullability -verify %s
2
3void it_takes_two(int a, int b);
4void function_pointer_arity_mismatch() {
5 void(*fptr)() = it_takes_two;
Devin Coughlin8693adf2016-11-15 18:40:46 +00006 fptr(1); // no-crash expected-warning {{Function taking 2 arguments is called with fewer (1)}}
Devin Coughline4224cc2016-11-14 22:46:02 +00007}
8
9void block_arity_mismatch() {
Devin Coughlin8693adf2016-11-15 18:40:46 +000010 void(^b)() = ^(int a, int b) { };
11 b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}}
Devin Coughline4224cc2016-11-14 22:46:02 +000012}