blob: d57b986c3eac6cee0c2e2e7e821dd9cd35381395 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Steve Naroffed91f902009-04-02 18:37:59 +00003
4@interface Test {}
5+ (Test*)one;
6- (int)two;
7@end
8
9int main ()
10{
11 return Test.one.two;
12}
13
Stephen Hines6bcf27b2014-05-29 04:14:42 -070014// rdar://16650575
15__attribute__((objc_root_class))
16@interface RootClass {
17 Class isa;
18}
19
20@property int property;
21-(int)method;
22- (void) setMethod : (int)arg;
23+(int)classMethod;
24@end
25
26@interface Subclass : RootClass @end
27void Test1() {
28 // now okay
29 (void)RootClass.property;
30 (void)Subclass.property;
31 (void)RootClass.method;
32 (void)Subclass.method;
33
34 RootClass.property = 1;
35 Subclass.property = 2;
36 RootClass.method = 3;
37 Subclass.method = 4;
38
39 // okay
40 (void)RootClass.classMethod;
41 (void)Subclass.classMethod;
42
43 // also okay
Stephen Hines176edba2014-12-01 14:53:08 -080044 (void)[RootClass property];
45 (void)[Subclass property];
Stephen Hines6bcf27b2014-05-29 04:14:42 -070046 [RootClass method];
47 [Subclass method];
48 [RootClass classMethod];
49 [Subclass classMethod];
50
51 // also okay
52 [RootClass setProperty : 1];
53 [Subclass setProperty : 2];
54 [RootClass setMethod : 3];
55 [Subclass setMethod : 4];
56}