Since we do not allow a readonly property to be 'copy'retain', we

must allow the continuation class to extend it to a 'readwrite'
and 'copy/retain'.

llvm-svn: 60709
This commit is contained in:
Fariborz Jahanian 2008-12-08 18:47:29 +00:00
parent 5daeee2bd6
commit 3685995d2c
2 changed files with 2 additions and 6 deletions

View File

@ -1388,11 +1388,7 @@ Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
// with anonymous category's readwrite property attribute!
unsigned PIkind = PIDecl->getPropertyAttributes();
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
if ((Attributes & ObjCPropertyDecl::OBJC_PR_retain) !=
(PIkind & ObjCPropertyDecl::OBJC_PR_retain) ||
(Attributes & ObjCPropertyDecl::OBJC_PR_copy) !=
(PIkind & ObjCPropertyDecl::OBJC_PR_copy) ||
(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) !=
if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) !=
(PIkind & ObjCPropertyDecl::OBJC_PR_nonatomic))
Diag(AtLoc, diag::warn_property_attr_mismatch);
PIDecl->makeitReadWriteAttribute();

View File

@ -10,6 +10,6 @@
@end
@interface ReadOnly ()
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
@property(readwrite, copy) id object;
@property(readonly) id object1; // expected-error {{attribute of property in continuation class of 'ReadOnly' can only be 'readwrite'}}
@end