forked from OSchip/llvm-project
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:
parent
5daeee2bd6
commit
3685995d2c
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue