mirror of https://github.com/microsoft/clang.git
Don't warn on missing 'copy' attribute on a 'block'
property when it is 'readonly'. // rdar://8820813 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b1cf305c9
commit
2b77cb803c
|
@ -1326,6 +1326,7 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
|
|||
}
|
||||
|
||||
if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
|
||||
&&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
|
||||
&& getLangOptions().getGCMode() == LangOptions::GCOnly
|
||||
&& PropertyTy->isBlockPointerType())
|
||||
Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
|
||||
|
|
|
@ -6,5 +6,7 @@
|
|||
@property void(^someBlock)(void); // expected-warning {{'copy' attribute must be specified for the block property}}
|
||||
@property(copy) void(^OK)(void);
|
||||
|
||||
// rdar://8820813
|
||||
@property (readonly) void (^block)(void); // readonly property is OK
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue