diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-17 23:35:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-17 23:35:13 +0000 |
commit | 96c7d0173a9110c73f63c2c121017cceff2fffc0 (patch) | |
tree | 9dd4f8f53ca3eb1e392ccdda73bb122bbdaa66f8 /lib/Sema/SemaExprObjC.cpp | |
parent | 9bef4617c65567453527b199f29b535e56677206 (diff) | |
download | clang-96c7d0173a9110c73f63c2c121017cceff2fffc0.tar.gz clang-96c7d0173a9110c73f63c2c121017cceff2fffc0.tar.bz2 clang-96c7d0173a9110c73f63c2c121017cceff2fffc0.tar.xz |
Objective-C ARC. Do not warn about properties with both
IBOutlet and weak attributes when accessed being
unpredictably set to nil because usage of such properties
are always single threaded and its ivar cannot be set
to nil asynchronously. // rdar://15885642
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index ffb6b037ec..c6a7d7c13d 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2640,7 +2640,14 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, } if (getLangOpts().ObjCAutoRefCount) { - DiagnoseARCUseOfWeakReceiver(*this, Receiver); + // Do not warn about IBOutlet weak property receivers being set to null + // as this cannot asynchronously happen. + bool WarnWeakReceiver = true; + if (isImplicit && Method) + if (const ObjCPropertyDecl *PropertyDecl = Method->findPropertyDecl()) + WarnWeakReceiver = !PropertyDecl->hasAttr<IBOutletAttr>(); + if (WarnWeakReceiver) + DiagnoseARCUseOfWeakReceiver(*this, Receiver); // In ARC, annotate delegate init calls. if (Result->getMethodFamily() == OMF_init && |