writable property in a category of class's superclass

makes the property writable in the current class.
 

llvm-svn: 68446
This commit is contained in:
Fariborz Jahanian 2009-04-06 16:59:10 +00:00
parent dcceee734c
commit 15e3a5c4b8
2 changed files with 20 additions and 0 deletions

View File

@ -835,6 +835,9 @@ bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
ObjCImplementations[IDecl->getIdentifier()]) ObjCImplementations[IDecl->getIdentifier()])
if (ImpDecl->getInstanceMethod(PDecl->getSetterName())) if (ImpDecl->getInstanceMethod(PDecl->getSetterName()))
return false; return false;
// If all fails, look at the super class.
if (ObjCInterfaceDecl *SIDecl = IDecl->getSuperClass())
return isPropertyReadonly(PDecl, SIDecl);
return true; return true;
} }

View File

@ -0,0 +1,17 @@
// RUN: clang-cc -fsyntax-only -verify %s
@interface MessageStore
@property (assign, readonly) int P;
@end
@interface MessageStore (CAT)
@property (assign) int P;
@end
@interface NeXTMbox : MessageStore
@end
@implementation NeXTMbox
- (void) Meth { self.P = 1; }
@end