The check should not trigger on lvalue/rvalue overload pairs:
struct S { S(const A& a) : a(a) {} S(A&& a) : a(std::move(a)) {} A a; }
Paths
| Differential D116535
[clang-tidy] Fix false positive in modernize-pass-by-value ClosedPublic Authored by courbet on Jan 3 2022, 5:46 AM.
Details Summary The check should not trigger on lvalue/rvalue overload pairs: struct S { S(const A& a) : a(a) {} S(A&& a) : a(std::move(a)) {} A a; }
Diff Detail
Event Timelineflx added inline comments. This revision is now accepted and ready to land.Jan 4 2022, 7:01 AM This revision was landed with ongoing or failed builds.Jan 5 2022, 5:34 AM Closed by commit rGed8ff29aa683: [clang-tidy] Fix false positive in modernize-pass-by-value (authored by courbet). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 397545 clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize-pass-by-value.cpp
|
if