[FEA]: Add clang-tidy option to prevent capturing variables in lambdas when using coroutines #1582
Open
2 tasks done
Labels
feature request
New feature or request
Is this a new feature, an improvement, or a change to existing functionality?
Improvement
How would you describe the priority of this feature request
Medium
Please provide a clear description of problem this feature solves
C++ Lambdas and Coroutines don't play well together. Capturing a value in a coroutine lambda introduces undefined behaviour where the capture may be lost prior to usage. Enabling
cppcoreguidelines-avoid-capturing-lambda-coroutines
as an error will prevent us from writing code that suffers this problem.https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-capturing-lambda-coroutines.html
Describe your ideal solution
Enable
cppcoreguidelines-avoid-capturing-lambda-coroutines
in clang-tidy.Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: