[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18
Carlos Galvez via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 4 09:20:16 PST 2023
carlosgalvezp added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp:88
+
+ if (!Param) {
+ return;
----------------
Nit: the style convention in LLVM is to not use braces with one-line `if/else`.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/rvalue-reference-param-not-moved.cpp:52
+void never_moves_params(Obj&& o1, Obj&& o2) {
+ // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: rvalue reference parameter is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
+ // CHECK-MESSAGES: :[[@LINE-2]]:41: warning: rvalue reference parameter is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
----------------
It would be good for the check to specify which parameter it's referring to, for example:
```
rvalue reference paramter 'o1' is never moved...
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141569/new/
https://reviews.llvm.org/D141569
More information about the cfe-commits
mailing list