llvm-project/clang-tools-extra/docs/clang-tidy
Greg Miller d038faea46 [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef
This option allows callers to disable the warning from
https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html
that would warn on the following

```
void f(const string &s);
string s;
f(std::move(s));  // ALLOWED if performance-move-const-arg.CheckMoveToConstRef=false
```

The reason people might want to disable this check, is because it allows
callers to use `std::move()` or not based on local reasoning about the
argument, and without having to care about how the function `f` accepts
the argument. Indeed, `f` might accept the argument by const-ref today,
but change to by-value tomorrow, and if the caller had moved the
argument that they were finished with, the code would work as
efficiently as possible regardless of how `f` accepted the parameter.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D119370
2022-02-10 13:31:07 +00:00
..
checks [clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef 2022-02-10 13:31:07 +00:00
Contributing.rst Reland "enable plugins for clang-tidy" 2022-02-01 17:37:24 -05:00
Integrations.rst [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
index.rst Reland "enable plugins for clang-tidy" 2022-02-01 17:37:24 -05:00