[PATCH] D146921: [clang-tidy] Implement cppcoreguidelines F.19
Chris Cotter via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 27 19:09:01 PDT 2023
ccotter added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ForwardingReferenceParamNotForwardedCheck.cpp:20
+
+AST_MATCHER(Expr, hasUnevaluatedContext) {
+ if (isa<CXXNoexceptExpr>(Node) || isa<RequiresExpr>(Node))
----------------
PiotrZSL wrote:
> move this matcher to some utils/...
> It may be needed by other checks.
>
Will be done in https://reviews.llvm.org/D146929
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/forwarding-reference-param-not-forwarded.cpp:138
+
+} // namespace negative_cases
----------------
PiotrZSL wrote:
> what about when someone uses std::move instead of std::format ?
> maybe some "note" for such issue ?
Are you suggesting to have the tool add a special note in something like
```
template <class T>
void foo(T&& t) { T other = std::move(t); }
```
I'm not sure I completely followed what you were saying. Or perhaps a fixit for this specific case of using move on a forwarding reference (fixit to replace `move` with `forward`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146921/new/
https://reviews.llvm.org/D146921
More information about the cfe-commits
mailing list