[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 12 11:50:16 PST 2023


njames93 added a comment.

It'd be interesting to see how this handles variadic templates, I have a feeling if it isn't done correctly, there will be a lot of false positives. Can test be added to demonstrate the behaviour.
What happens with code like this

  void foo(bar&& B) {
    std::move(B);
  }



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/rvalue-reference-param-not-moved.cpp:3-35
+// NOLINTBEGIN
+namespace std {
+template <typename>
+struct remove_reference;
+
+template <typename _Tp>
+struct remove_reference {
----------------
You can just declare these methods and the base struct, no need to do anything fancy in here and put definitions in there


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