diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-04-21 20:22:17 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-04-21 20:22:17 +0000 |
| commit | 29cdbc63193d2c8cbf7fc370237fb5d306a07047 (patch) | |
| tree | b641b6184098870e79cadb78886fee3d2e2ae1ed /clang/test/SemaObjC | |
| parent | b0b7b18e8cb64fcb9f16bfee9b4cad0025d01ae4 (diff) | |
| download | bcm5719-llvm-29cdbc63193d2c8cbf7fc370237fb5d306a07047.tar.gz bcm5719-llvm-29cdbc63193d2c8cbf7fc370237fb5d306a07047.zip | |
Objective-C. Patch to allow use of dot syntax on class
objects to fund root class's instance methods.
// rdar://16650575
llvm-svn: 206781
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/class-property-access.m | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/class-property-access.m b/clang/test/SemaObjC/class-property-access.m index 735b51a3c43..a4c188c434e 100644 --- a/clang/test/SemaObjC/class-property-access.m +++ b/clang/test/SemaObjC/class-property-access.m @@ -11,3 +11,46 @@ int main () return Test.one.two; } +// rdar://16650575 +__attribute__((objc_root_class)) +@interface RootClass { + Class isa; +} + +@property int property; +-(int)method; +- (void) setMethod : (int)arg; ++(int)classMethod; +@end + +@interface Subclass : RootClass @end +void Test1() { + // now okay + (void)RootClass.property; + (void)Subclass.property; + (void)RootClass.method; + (void)Subclass.method; + + RootClass.property = 1; + Subclass.property = 2; + RootClass.method = 3; + Subclass.method = 4; + + // okay + (void)RootClass.classMethod; + (void)Subclass.classMethod; + + // also okay + [RootClass property]; + [Subclass property]; + [RootClass method]; + [Subclass method]; + [RootClass classMethod]; + [Subclass classMethod]; + + // also okay + [RootClass setProperty : 1]; + [Subclass setProperty : 2]; + [RootClass setMethod : 3]; + [Subclass setMethod : 4]; +} |

