[PATCH] D107450: [clang-tidy] Fix wrong and missing warnings in performance-move-const-arg

liushuai wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 10 06:33:57 PDT 2021


MTC added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/performance-move-const-arg.cpp:261
+  showInt(std::move(a));
+  // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: std::move of the variable 'a' of the trivially-copyable type 'int' has no effect; consider changing showInt's parameter from 'int'&& to 'int'&
+  return std::move(a);
----------------
Change **'int'&&**  -> **'int&&'** and **'int&'** -> **int**. 

Make `consider changing showInt's parameter from 'int'&& to 'int'&` as a note instead of a warning. And I don't have a strong preference for the position of the note, but I personally want to put it in the source location of the function definition. and 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107450/new/

https://reviews.llvm.org/D107450



More information about the cfe-commits mailing list