]> granicus.if.org Git - clang/commitdiff
objective-c mrc: Issue warning for mrc, as is done for arc, when
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 27 Jun 2012 20:52:46 +0000 (20:52 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 27 Jun 2012 20:52:46 +0000 (20:52 +0000)
property retains a block object as it could be on
the stack. // rdar://11761511

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

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/warn-retain-block-property.m [moved from test/SemaObjC/arc-retain-block-property.m with 92% similarity]

index 13350eaf37c2519abad1220f626f39935932f6c6..1794f6618a15a26d9713d2b2d1330e2b96d16648 100644 (file)
@@ -2143,8 +2143,7 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
       && getLangOpts().getGC() == LangOptions::GCOnly
       && PropertyTy->isBlockPointerType())
     Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
-  else if (getLangOpts().ObjCAutoRefCount &&
-           (Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+  else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
            !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
            !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
            PropertyTy->isBlockPointerType())
similarity index 92%
rename from test/SemaObjC/arc-retain-block-property.m
rename to test/SemaObjC/warn-retain-block-property.m
index 3b66d149302c7063c46cf4d106f6f1d6199b79a9..3a54baf0f5a91b847cabb9b7030276f52a41b8bb 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -verify -Wno-objc-root-class %s
 // rdar://9829425
+// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -Wno-objc-root-class %s
+// rdar://11761511
 
 extern void doSomething();