Signed-off-by: Noah Watkins <noah@redpanda.com>
Details
- Reviewers
njames93 carlosgalvezp ChuanqiXu dotnwat - Group Reviewers
Restricted Project - Commits
- rG54178fc6161a: [clang-tidy] add check for capturing lambda coroutines
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is helpful. I feel it is OK to add the warning in the clang too. Are you interested in that?
Yes, but unfortunately I'm very time constrained until the end of the year. Is that something that would need to be added to this diff, or could be separate? (fyi, brand new to clang development)
Oh, I am not blocking this patch and this patch looks good to me and self-contained. That's just a simple suggestion.
Looking good! Some minor comments
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidCapturingLambdaCoroutinesCheck.cpp | ||
---|---|---|
41 | Perhaps it would be good with a diagnostic that gives more actionable feedback? For example "avoid capturing coroutines in a lambda" | |
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidCapturingLambdaCoroutinesCheck.h | ||
19 | Start the documentation describing "what" the check warns for (here you explain the "why"). Make sure this text is in sync with the .rst documentation. | |
29 | Limit to C++20 using isLanguageVersionSupported | |
clang-tools-extra/docs/ReleaseNotes.rst | ||
126 | C++ Core Guidelines | |
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-avoid-capturing-lambda-coroutines.rst | ||
23 ↗ | (On Diff #473522) | Mention that the check implements rule CP.51 of C++ Core Guidelines, and add a link to the that guideline (see other C++ Core Guidelines checks as an example). |
24 ↗ | (On Diff #473522) | does |
clang-tools-extra/docs/clang-tidy/checks/list.rst | ||
182 | Remove, since this check does not provide fix-its. | |
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-avoid-capturing-lambda-coroutines.cpp | ||
1–2 ↗ | (On Diff #473522) | I think it's easier to read and reason about if you keep it in one line. |
2 ↗ | (On Diff #473522) | It's strange to have this test depend on input data from another module - create a Inputs folder inside the cppcoreguidelines folder and copy coroutines.h there. |
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidCapturingLambdaCoroutinesCheck.cpp | ||
---|---|---|
41 | I meant to remove this comment since it's rather nitpick, please ignore :) |
Start the documentation describing "what" the check warns for (here you explain the "why"). Make sure this text is in sync with the .rst documentation.