blob: dd8380aea928d215d5476611406850c6338f774e [file] [log] [blame]
Steve Naroffc0febd52008-12-10 17:49:55 +00001// RUN: clang -fsyntax-only -verify -fblocks %s
2@protocol NSObject;
3
4void bar(id(^)(void));
5void foo(id <NSObject>(^objectCreationBlock)(void)) {
6 return bar(objectCreationBlock);
7}
8
9void bar2(id(*)(void));
10void foo2(id <NSObject>(*objectCreationBlock)(void)) {
11 return bar2(objectCreationBlock);
12}
13
14void bar3(id(*)());
15void foo3(id (*objectCreationBlock)(int)) {
16 return bar3(objectCreationBlock);
17}
18
19void bar4(id(^)());
20void foo4(id (^objectCreationBlock)(int)) {
21 return bar4(objectCreationBlock); // expected-warning{{incompatible block pointer types passing 'id (^)(int)', expected 'id (^)()'}}
22}