]> granicus.if.org Git - clang/commitdiff
Turn on -Wblock-capture-autoreleasing by default.
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 26 Jan 2017 18:51:10 +0000 (18:51 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 26 Jan 2017 18:51:10 +0000 (18:51 +0000)
Turning on the warning by default helps the users as it's a common
mistake to capture out-parameters in a block without ensuring the object
assigned doesn't get released.

rdar://problem/30200058

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

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaObjC/arc.m

index 0a0ddda0edc8d43da162f367fcf5a6fc19154c79..7f7ef1848a009b7a394821bf288508607c894f6a 100644 (file)
@@ -5185,7 +5185,7 @@ def err_arc_inconsistent_property_ownership : Error<
 def warn_block_capture_autoreleasing : Warning<
   "block captures an autoreleasing out-parameter, which may result in "
   "use-after-free bugs">,
-  InGroup<BlockCaptureAutoReleasing>, DefaultIgnore;
+  InGroup<BlockCaptureAutoReleasing>;
 def note_declare_parameter_autoreleasing : Note<
   "declare the parameter __autoreleasing explicitly to suppress this warning">;
 def note_declare_parameter_strong : Note<
index 2aeecdb4440922e538d430e5470f65c2b638d003..72c07a9ff109239a767cd45bf9a53efd70b3ca20 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class -Wblock-capture-autoreleasing %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class %s
 
 typedef unsigned long NSUInteger;
 typedef const void * CFTypeRef;