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:
Fariborz Jahanian 2011-01-05 23:00:04 +00:00
parent 7b1cf305c9
commit 2b77cb803c
2 changed files with 3 additions and 0 deletions

View File

@ -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);

View File

@ -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