forked from OSchip/llvm-project
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:
parent
dcceee734c
commit
15e3a5c4b8
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue