diff options
| author | Steve Naroff <snaroff@apple.com> | 2009-02-26 19:11:32 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2009-02-26 19:11:32 +0000 |
| commit | de68001e764dc323dfeb6dc011ca385d8834078b (patch) | |
| tree | 04afdcd92cbb0e18a8937307a716b552bc070a39 /clang/lib/Sema/SemaDeclObjC.cpp | |
| parent | 659ed19150ccc1ffd48afd776ac2d47515de599a (diff) | |
| download | bcm5719-llvm-de68001e764dc323dfeb6dc011ca385d8834078b.tar.gz bcm5719-llvm-de68001e764dc323dfeb6dc011ca385d8834078b.zip | |
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.
llvm-svn: 65562
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |

