xref: /llvm-project/clang/test/SemaObjC/resolve-method-in-global-pool.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
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@interface NSObject
6+ (void)clsMethod:(int*)arg;
7@end
8
9@class NSDictionary;
10@class NSError;
11
12@interface Foo : NSObject
13- (void)getDonuts:(void (^)(NSDictionary *, NSError *))replyBlock;
14- (void)getCake:(int*)arg, ...;
15@end
16
17@protocol Protocol
18@required
19- (void)getDonuts:(void (^)(NSDictionary *))replyBlock;
20- (void)getCake:(float*)arg, ...;
21+ (void)clsMethod:(float*)arg;
22@end
23
24@implementation Foo
25{
26  float g;
27}
28
29- (void)getDonuts:(void (^)(NSDictionary *, NSError *))replyBlock {
30    [(id) 0 getDonuts:^(NSDictionary *replyDict) { }];
31}
32
33- (void) getCake:(int*)arg, ... {
34    [(id)0 getCake: &g, 1,3.14];
35}
36@end
37
38void func( Class c, float g ) {
39    [c clsMethod: &g];
40}
41
42@protocol NSKeyedArchiverDelegate @end
43
44@interface NSKeyedArchiver
45@property (assign) id <NSKeyedArchiverDelegate> delegate;
46@end
47
48@interface NSConnection
49@property (assign) id delegate;
50@end
51
52extern id NSApp;
53
54@interface AppDelegate
55@end
56
57AppDelegate* GetDelegate(void)
58{
59    return [NSApp delegate];
60}
61