Mercurial > hg > CbC > CbC_llvm
comparison clang/test/SemaObjC/class-property-access.m @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 // RUN: %clang_cc1 -fsyntax-only -verify %s | |
2 // expected-no-diagnostics | |
3 | |
4 @interface Test {} | |
5 + (Test*)one; | |
6 - (int)two; | |
7 @end | |
8 | |
9 int main () | |
10 { | |
11 return Test.one.two; | |
12 } | |
13 | |
14 // 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 | |
27 void 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 | |
44 (void)[RootClass property]; | |
45 (void)[Subclass property]; | |
46 [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 } |