brintos

brintos / llvm-project-archived public Read only

0
0
Text · 598 B · 850b01c Raw
20 lines · plain
1.. title:: clang-tidy - bugprone-no-escape2 3bugprone-no-escape4==================5 6Finds pointers with the ``noescape`` attribute that are captured by an7asynchronously-executed block. The block arguments in ``dispatch_async()`` and8``dispatch_after()`` are guaranteed to escape, so it is an error if a pointer9with the ``noescape`` attribute is captured by one of these blocks.10 11The following is an example of an invalid use of the ``noescape`` attribute.12 13  .. code-block:: objc14 15    void foo(__attribute__((noescape)) int *p) {16      dispatch_async(queue, ^{17        *p = 123;18      });19    });20