summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/Sema.h2
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 533386cab55..25f2164ed07 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -887,7 +887,7 @@ public:
NamespaceDecl *GetStdNamespace();
bool isPropertyReadonly(ObjCPropertyDecl *PropertyDecl,
- ObjCInterfaceDecl *IDecl) const;
+ ObjCInterfaceDecl *IDecl);
/// CheckProtocolMethodDefs - This routine checks unimplemented
/// methods declared in protocol, and those referenced by it.
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index b3644a5ab9c..cb35890b3f1 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud