aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/direct-synthesized-ivar-access.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-11-17 19:41:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-11-17 19:41:23 +0000
commitde2676076ba218b5c09a88ac26dd86cc97a9d02e (patch)
tree21d82775d5c9a280bb520a8ef355ce14b33253aa /test/SemaObjC/direct-synthesized-ivar-access.m
parent47d512c337d06376d56beeb7eccc7c581ed5ff57 (diff)
Warn if direct accessing synthesized ivar backing the property in
nonofragile-abi2. Fixes //rdar://8673791 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC/direct-synthesized-ivar-access.m')
-rw-r--r--test/SemaObjC/direct-synthesized-ivar-access.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaObjC/direct-synthesized-ivar-access.m b/test/SemaObjC/direct-synthesized-ivar-access.m
new file mode 100644
index 0000000000..e59fa81662
--- /dev/null
+++ b/test/SemaObjC/direct-synthesized-ivar-access.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -Wnonfragile-abi2 -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
+// rdar://8673791
+
+@interface I {
+}
+
+@property int IVAR; // expected-note {{property declared here}}
+- (int) OK;
+@end
+
+@implementation I
+- (int) Meth { return IVAR; } // expected-warning {{direct access of synthesized ivar by using property access 'IVAR'}}
+- (int) OK { return self.IVAR; }
+@end