aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-25 00:17:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-25 00:17:46 +0000
commit831fb9622581fc3b777848e6b097a0cb23d124de (patch)
tree4f39c6cba98cf0045b3748c0f0f13ff8934a14dd /lib/Sema/SemaDeclAttr.cpp
parent88c1dfccf8c5d487408e3365c752ed24c867c7ce (diff)
objc-arc/mrc: Allow ns_returns_not_retained attribute on properties
to turn off warning on those properties which follow Cocoa naming convention for retaining objects and yet they were not meant for such purposes. Also, perform consistancy checking for declared getters of such methods. // rdar://9636091 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 240c15a8e0..9302277e13 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -2716,6 +2716,8 @@ static void HandleNSReturnsRetainedAttr(Decl *d, const AttributeList &attr,
if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(d))
returnType = MD->getResultType();
+ else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(d))
+ returnType = PD->getType();
else if (S.getLangOptions().ObjCAutoRefCount && hasDeclarator(d) &&
(attr.getKind() == AttributeList::AT_ns_returns_retained))
return; // ignore: was handled as a type attribute