1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks -Wno-objc-root-class %s |
2 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks -Wno-objc-root-class %s |
3 | // expected-no-diagnostics |
4 | |
5 | // rdar://16808765 |
6 | |
7 | @interface NSObject |
8 | + (void)clsMethod:(int*)arg; |
9 | @end |
10 | |
11 | @class NSDictionary; |
12 | @class NSError; |
13 | |
14 | @interface Foo : NSObject |
15 | - (void)getDonuts:(void (^)(NSDictionary *, NSError *))replyBlock; |
16 | - (void)getCake:(int*)arg, ...; |
17 | @end |
18 | |
19 | @protocol Protocol |
20 | @required |
21 | - (void)getDonuts:(void (^)(NSDictionary *))replyBlock; |
22 | - (void)getCake:(float*)arg, ...; |
23 | + (void)clsMethod:(float*)arg; |
24 | @end |
25 | |
26 | @implementation Foo |
27 | { |
28 | float g; |
29 | } |
30 | |
31 | - (void)getDonuts:(void (^)(NSDictionary *, NSError *))replyBlock { |
32 | [(id) 0 getDonuts:^(NSDictionary *replyDict) { }]; |
33 | } |
34 | |
35 | - (void) getCake:(int*)arg, ... { |
36 | [(id)0 getCake: &g, 1,3.14]; |
37 | } |
38 | @end |
39 | |
40 | void func( Class c, float g ) { |
41 | [c clsMethod: &g]; |
42 | } |
43 | |
44 | // rdar://18095772 |
45 | @protocol NSKeyedArchiverDelegate @end |
46 | |
47 | @interface NSKeyedArchiver |
48 | @property (assign) id <NSKeyedArchiverDelegate> delegate; |
49 | @end |
50 | |
51 | @interface NSConnection |
52 | @property (assign) id delegate; |
53 | @end |
54 | |
55 | extern id NSApp; |
56 | |
57 | @interface AppDelegate |
58 | @end |
59 | |
60 | AppDelegate* GetDelegate() |
61 | { |
62 | return [NSApp delegate]; |
63 | } |
64 | |