[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18
Piotr Zegar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 21 06:36:41 PST 2023
PiotrZSL added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp:26-29
+ unless(hasType(qualType(references(templateTypeParmType(
+ hasDeclaration(templateTypeParmDecl())))))),
+ unless(
+ hasType(qualType(references(substTemplateTypeParmType())))),
----------------
if with this you want to exclude parameters that depend on templates, consider looking into isTemplateInstantiation AST matcher, other option could be to get DeclContext and check isDependentContext(). You would need to check this, maybe look into other checks how its done there. Simply because if this would be for example T* &&, then it could not be detected.
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