OSDN Git Service

Warn pointer captured in async block
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Tue, 7 Jul 2020 17:30:36 +0000 (13:30 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 7 Jul 2020 17:31:14 +0000 (13:31 -0400)
commitdfa0db79d0e37d5cf24a63d1e2b7ba5f40617574
tree2619975c0755efb5b392349cabec9fa5f13e1438
parent79b30af0ec53de7c7e3378465124ff1026a77f75
Warn pointer captured in async block

The block arguments in dispatch_async() and dispatch_after() are
guaranteed to escape. If those blocks capture any pointers with the
noescape attribute then it is an error.
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-no-escape.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone-no-escape.m [new file with mode: 0644]