forked from OSchip/llvm-project
Since default writable attribute is 'assign', allow
specification of 'assign' (no warning to be issued), when a continuation class makes a 'readonly' attribute 'readwrite' but also specifies the 'assign' attribute. (this matches gcc's behavior and prevents exessive warnings)/ llvm-svn: 86297
This commit is contained in:
parent
b29e155c53
commit
3600f41a3a
|
@ -1911,8 +1911,7 @@ Sema::DeclPtrTy Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
|
|||
unsigned PIkind = PIDecl->getPropertyAttributes();
|
||||
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
|
||||
unsigned assignRetainCopyNonatomic =
|
||||
(ObjCPropertyDecl::OBJC_PR_assign |
|
||||
ObjCPropertyDecl::OBJC_PR_retain |
|
||||
(ObjCPropertyDecl::OBJC_PR_retain |
|
||||
ObjCPropertyDecl::OBJC_PR_copy |
|
||||
ObjCPropertyDecl::OBJC_PR_nonatomic);
|
||||
if ((Attributes & assignRetainCopyNonatomic) !=
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
}
|
||||
@property(readonly) id object; // expected-note {{property declared here}}
|
||||
@property(readwrite, assign) id object1; // expected-note {{property declared here}}
|
||||
@property (readonly) int indentLevel;
|
||||
@end
|
||||
|
||||
@interface ReadOnly ()
|
||||
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
|
||||
@property(readonly) id object1; // expected-error {{property declaration in continuation class of 'ReadOnly' is to change a 'readonly' property to 'readwrite'}}
|
||||
@property (readwrite, assign) int indentLevel; // OK. assign the the default in any case.
|
||||
@end
|
||||
|
||||
@protocol Proto
|
||||
|
|
Loading…
Reference in New Issue