1 // RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
4 typedef void (^block1_t)(int arg);
5 typedef void (^block2_t)(block1_t arg);
6 typedef void (^block3_t)(NSObject *arg);
7 typedef void (^block4_t)(id arg);
9 void fn(block4_t arg); // expected-note {{passing argument to parameter 'arg' here}}
11 void another_fn(block2_t arg);
20 fn(b1); // expected-error {{incompatible block pointer types passing 'block1_t' (aka 'void (^)(int)') to parameter of type 'block4_t' (aka 'void (^)(id)')}}
21 fn(b2); // must succeed: block1_t *is* compatible with id
22 fn(b3); // succeeds: NSObject* compatible with id
23 fn(b4); // succeeds: id compatible with id