[cfe-commits] r122923 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/block-attr.m
Fariborz Jahanian
fjahanian at apple.com
Wed Jan 5 15:00:04 PST 2011
Author: fjahanian
Date: Wed Jan 5 17:00:04 2011
New Revision: 122923
URL: http://llvm.org/viewvc/llvm-project?rev=122923&view=rev
Log:
Don't warn on missing 'copy' attribute on a 'block'
property when it is 'readonly'. // rdar://8820813
Modified:
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/test/SemaObjC/block-attr.m
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=122923&r1=122922&r2=122923&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Wed Jan 5 17:00:04 2011
@@ -1326,6 +1326,7 @@
}
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);
Modified: cfe/trunk/test/SemaObjC/block-attr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/block-attr.m?rev=122923&r1=122922&r2=122923&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/block-attr.m (original)
+++ cfe/trunk/test/SemaObjC/block-attr.m Wed Jan 5 17:00:04 2011
@@ -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
+ at property (readonly) void (^block)(void); // readonly property is OK
@end
More information about the cfe-commits
mailing list