summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/objc-buffered-methods.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-08-31 17:37:55 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-08-31 17:37:55 +0000
commitbd0642fedee65f410b91c597a6d23bcd2a50f2a1 (patch)
tree028883de77b72ef951cdde003f1fe17d75360521 /clang/test/SemaObjC/objc-buffered-methods.m
parentcdef71f4f3f7633cb8b792e1dd07c8e0b4f9f8ac (diff)
downloadbcm5719-llvm-bd0642fedee65f410b91c597a6d23bcd2a50f2a1.tar.gz
bcm5719-llvm-bd0642fedee65f410b91c597a6d23bcd2a50f2a1.zip
objective-c - This patch buffers method implementations
and does the Sema on their body after the entire class/category @implementation is seen. This change allows messaging of forward private methods, as well as, access to synthesized ivars of properties with foward synthesize declarations; among others. In effect, this patch removes several restrictions placed on objective-c due to in-place semantics processing of methods. This is part of // rdar://8843851. llvm-svn: 138865
Diffstat (limited to 'clang/test/SemaObjC/objc-buffered-methods.m')
-rw-r--r--clang/test/SemaObjC/objc-buffered-methods.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/objc-buffered-methods.m b/clang/test/SemaObjC/objc-buffered-methods.m
new file mode 100644
index 00000000000..5794ee2bc6b
--- /dev/null
+++ b/clang/test/SemaObjC/objc-buffered-methods.m
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -verify %s
+// rdar://8843851
+
+int* global;
+
+@interface I
+- (void) Meth;
+@property int prop;
+@property int prop1;
+@end
+
+@implementation I
++ (void) _defaultMinSize { };
+static void _initCommon() {
+ Class graphicClass;
+ [graphicClass _defaultMinSize];
+}
+
+- (void) Meth { [self Forw]; } // No warning now
+- (void) Forw {}
+- (int) func { return prop; } // compiles - synthesized ivar will be accessible here.
+- (int)get_g { return global; } // No warning here - synthesized ivar will be accessible here.
+@synthesize prop;
+@synthesize prop1=global;
+@end
OpenPOWER on IntegriCloud