[all-commits] [llvm/llvm-project] c94444: [clangtidy] Allow safe suspensions in coroutine-ho...

Utkarsh Saxena via All-commits all-commits at lists.llvm.org
Mon Nov 27 07:21:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c94444390f4c8f4d898ac8a8444bc4bf3394609f
      https://github.com/llvm/llvm-project/commit/c94444390f4c8f4d898ac8a8444bc4bf3394609f
  Author: Utkarsh Saxena <usx at google.com>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/CoroutineHostileRAIICheck.cpp
    M clang-tools-extra/clang-tidy/misc/CoroutineHostileRAIICheck.h
    M clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst
    M clang-tools-extra/test/clang-tidy/checkers/misc/coroutine-hostile-raii.cpp

  Log Message:
  -----------
  [clangtidy] Allow safe suspensions in coroutine-hostile-raii check (#72954)

Certain `awaitable` types could be safe to `co_await` on even when we
have suspension-hostile RAII objects in scope.
This PR adds a way for users to mark such safe `awaitable` and silence
false positive warnings in `co_await` expressions involving such an
`awaitable`.

`co_await`-ing an expression of `awaitable` type is considered safe if
the type is part of `SafeAwaiatablesList` check option. RAII objects
persisting across such a `co_await` expression are
considered safe and hence are not flagged.




More information about the All-commits mailing list