aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-02-26 19:11:32 +0000
committerSteve Naroff <snaroff@apple.com>2009-02-26 19:11:32 +0000
commit22dc0b04351f5d3feeb6e121f330fb8ae18090e3 (patch)
tree77f18eb4e68b62800d7ead04091ed2ef774761ee /lib/Sema/SemaDeclObjC.cpp
parent24a9f6e11d222f2d9feaf5f9605c1a66006f7061 (diff)
Fix <rdar://problem/6574319> clang issues error on 'readonly' property with a defaul setter attribute.
Needed to make isPropertyReadonly() non-const (for this fix to compile). I imagine there's a way to retain the const-ness, however I have more important fish to fry. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index b3644a5ab9..cb35890b3f 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -720,7 +720,7 @@ void Sema::WarnConflictingTypedMethods(ObjCMethodDecl *ImpMethodDecl,
/// for the property in the class and in its categories and implementations
///
bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
- ObjCInterfaceDecl *IDecl) const {
+ ObjCInterfaceDecl *IDecl) {
// by far the most common case.
if (!PDecl->isReadOnly())
return false;
@@ -758,6 +758,11 @@ bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
return false;
}
}
+ // Lastly, look through the implementation (if one is in scope).
+ if (ObjCImplementationDecl *ImpDecl =
+ ObjCImplementations[IDecl->getIdentifier()])
+ if (ImpDecl->getInstanceMethod(PDecl->getSetterName()))
+ return false;
return true;
}