diff options
Diffstat (limited to 'clang/test/SemaObjC/weak-receiver-warn.m')
| -rw-r--r-- | clang/test/SemaObjC/weak-receiver-warn.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/weak-receiver-warn.m b/clang/test/SemaObjC/weak-receiver-warn.m index 56d9bc10f97..e6f8eaba8c5 100644 --- a/clang/test/SemaObjC/weak-receiver-warn.m +++ b/clang/test/SemaObjC/weak-receiver-warn.m @@ -66,3 +66,15 @@ void test0(Test0 *x) { } @end + + +// Weak properties on protocols can be synthesized by an adopting class. +@protocol MyProtocol +@property (weak) id object; // expected-note 2 {{property declared here}} +@end + +void testProtocol(id <MyProtocol> input) { + [[input object] Meth]; // expected-warning {{weak property may be unpredictably null in ARC mode}} + [input.object Meth]; // expected-warning {{weak property may be unpredictably null in ARC mode}} +} + |

