[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 24 Oct 2016 21:45:54 +0000 (21:45 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 24 Oct 2016 21:45:54 +0000 (21:45 +0000)
commitc81708e6ecf01443b437abb553845caed464e115
treed78d24a1ab09834440c9537afdfdd34f3f84bf55
parent51c6d93fed3d95dd78e86fb5f9128e44e78f4855
[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

Differential Revision: https://reviews.llvm.org/D25844

llvm-svn: 285031
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaExpr.cpp
clang/test/SemaObjC/arc.m