summaryrefslogtreecommitdiffstats
path: root/test/FixIt
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-06-28 23:01:49 +0000
committerManman Ren <manman.ren@gmail.com>2016-06-28 23:01:49 +0000
commit982542debc28b9714c6c93c6417d0e1ea1a032ad (patch)
tree606329e31375527494337a1365fd7e42bca38664 /test/FixIt
parentfee7621b66d3b340f3e97c716ce27e48ab794498 (diff)
ObjC Class Property: diagnostics when accessing a class property using instance.
When a class property is accessed with an object instance, before this commit, we try to apply a typo correction of the same property: property 'c' not found on object of type 'A *'; did you mean 'c'? With this commit, we correctly emit a diagnostics: property 'c' is a class property; did you mean to access it with class 'A'? rdar://26866973 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r--test/FixIt/fixit-objc.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m
index f41f75f1d7..3e9ff60523 100644
--- a/test/FixIt/fixit-objc.m
+++ b/test/FixIt/fixit-objc.m
@@ -67,3 +67,11 @@ void sentinel_test(Sentinel *a) {
sentinel(1, 2, 3); // expected-warning{{missing sentinel in function call}}
[a sentinel:1, 2, 3]; // expected-warning{{missing sentinel in method dispatch}}
}
+
+@interface A
+@property (class) int c;
+@end
+
+int test(A *a) {
+ return a.c; // expected-error {{property 'c' is a class property; did you mean to access it with class 'A'}}
+}