summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-01-22 19:02:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-01-22 19:02:20 +0000
commitfba1e6641c7d62002f3f84e001be89cd520346dc (patch)
tree75a2205af9fb2021ed7fc24f66f37b4549ed34aa /lib/Sema/SemaDeclObjC.cpp
parent9c4750c1e5c526a47000154e478b339afd528e4d (diff)
ObjectiveC. When issuing property implementation is
not using backing ivar warning, ignore when property is not being synthesized (user declared its implementation @dynamic). // rdar://1583425 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index f7f1b4b565..78c26d38a9 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -3514,6 +3514,13 @@ void Sema::DiagnoseUnusedBackingIvarInAccessor(Scope *S,
const ObjCIvarDecl *IV = GetIvarBackingPropertyAccessor(CurMethod, PDecl);
if (!IV)
continue;
+ // Property declared as @dynamic must be ignored.
+ if (ObjCPropertyImplDecl *PropertyImpDecl =
+ Context.getObjCPropertyImplDeclForPropertyDecl(PDecl, ImplD))
+ if (PropertyImpDecl->getPropertyImplementation() ==
+ ObjCPropertyImplDecl::Dynamic)
+ continue;
+
UnusedBackingIvarChecker Checker(*this, CurMethod, IV);
Checker.TraverseStmt(CurMethod->getBody());