]> granicus.if.org Git - clang/commitdiff
Don't warn on missing 'copy' attribute on a 'block'
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 5 Jan 2011 23:00:04 +0000 (23:00 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 5 Jan 2011 23:00:04 +0000 (23:00 +0000)
property when it is 'readonly'. // rdar://8820813

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122923 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/block-attr.m

index 6aa1c693bc98b22259c9b095f16e059ab15f4940..71d87923456b1927de5a73509fd2d9223d12dd04 100644 (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);
index de203e711ede73b4a577b8da2a63b4cdbab254c3..80092fc31c1adbc00612e4e7b7677190e00d376e 100644 (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