blob: 523856d663f63ed4d45d7d96fa2c0c2242ad776c [file] [log] [blame]
Fariborz Jahanian30ae8d42014-08-13 21:07:35 +00001// 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
Fariborz Jahaniand288fad2014-08-13 23:38:04 +00007@interface NSObject
8+ (void)clsMethod:(int*)arg;
9@end
Fariborz Jahanian30ae8d42014-08-13 21:07:35 +000010
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, ...;
Fariborz Jahaniand288fad2014-08-13 23:38:04 +000023+ (void)clsMethod:(float*)arg;
Fariborz Jahanian30ae8d42014-08-13 21:07:35 +000024@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
Fariborz Jahaniand288fad2014-08-13 23:38:04 +000039
40void func( Class c, float g ) {
41 [c clsMethod: &g];
42}
Fariborz Jahanian180d76b2014-08-27 16:38:47 +000043
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
55extern id NSApp;
56
57@interface AppDelegate
58@end
59
60AppDelegate* GetDelegate()
61{
62 return [NSApp delegate];
63}