[clang-tidy] Fix false positive in modernize-pass-by-value
authorClement Courbet <courbet@google.com>
Mon, 3 Jan 2022 13:25:29 +0000 (14:25 +0100)
committerClement Courbet <courbet@google.com>
Wed, 5 Jan 2022 13:33:40 +0000 (14:33 +0100)
commited8ff29aa6835187f3d5e7b64de022fe6b33a131
treedfbfd63b08b6a0bde82cfd476512a1cc6f16fa72
parent3a2393795f2054d4ed6d1b8b57de9ea7395df759
[clang-tidy] Fix false positive in modernize-pass-by-value

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;
}
```

Differential Revision: https://reviews.llvm.org/D116535
clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize-pass-by-value.cpp