Debian Codegraph @

clang-tools-extra/docs/clang-tidy/checks/bugprone/no-escape.rst

raw
1 .. title:: clang-tidy - bugprone-no-escape
2
3 bugprone-no-escape
4 ==================
5
6 Finds pointers with the ``noescape`` attribute that are captured by an
7 asynchronously-executed block. The block arguments in ``dispatch_async()`` and
8 ``dispatch_after()`` are guaranteed to escape, so it is an error if a pointer with the
9 ``noescape`` attribute is captured by one of these blocks.
10
11 The following is an example of an invalid use of the ``noescape`` attribute.
12
13 .. code-block:: objc
14
15 void foo(__attribute__((noescape)) int *p) {
16 dispatch_async(queue, ^{
17 *p = 123;
18 });
19 });