diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-06-28 23:01:49 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-06-28 23:01:49 +0000 |
commit | 982542debc28b9714c6c93c6417d0e1ea1a032ad (patch) | |
tree | 606329e31375527494337a1365fd7e42bca38664 /test/FixIt | |
parent | fee7621b66d3b340f3e97c716ce27e48ab794498 (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.m | 8 |
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'}} +} |