[PATCH] D116535: [clang-tidy] Fix false positive in modernize-pass-by-value

Felix Berger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 4 07:01:44 PST 2022


flx accepted this revision.
flx added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp:108
 
+/// Returns true the given constructor is part of a lvalue/rvalue reference
+/// pair, i.e. `Param` is of lvalue reference type, and there exists another
----------------
if


================
Comment at: clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp:160
+      } else {
+        if (!(CandidateParamType == CtorParamType || IsLValueRValuePair))
+          return false;
----------------
A comment why we have to have a different check for  when the params are not at ParamIdx would be helpful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116535



More information about the cfe-commits mailing list