blob: d57b986c3eac6cee0c2e2e7e821dd9cd35381395 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbsc6e68da2012-10-19 12:44:48 +00002// expected-no-diagnostics
Steve Naroffd5ca2d02009-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
Fariborz Jahanian29cdbc62014-04-21 20:22:17 +000014// 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
Fariborz Jahanianac6b4ef2014-07-18 22:59:10 +000044 (void)[RootClass property];
45 (void)[Subclass property];
Fariborz Jahanian29cdbc62014-04-21 20:22:17 +000046 [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}