blob: e0836c6798bb29df93fdea32b191bad3d0ac695e [file] [log] [blame]
Dominic Chen184c6242017-03-03 18:02:02 +00001// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability -verify %s
Devin Coughline4224cc2016-11-14 22:46:02 +00002
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}