Issue |
132419
|
Summary |
[Clang-Tidy] `cppcoreguidelines-rvalue-reference-param-not-moved` false positive on rvalue references since C++20
|
Labels |
clang-tidy,
false-positive
|
Assignees |
|
Reporter |
MagentaTreehouse
|
Given this code:
```c++
struct A {
A(A &&) = default;
A &operator=(A &&) = default;
};
A f(A &&a) {
return a;
}
```
Even in C++20, Clang-Tidy says:
```console
<source>:6:9: warning: rvalue reference parameter 'a' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
6 | A f(A &&a) {
| ^
```
Seems like [P1825](https://wg21.link/P1825R0) is not fully implemented in this check.
See https://compiler-explorer.com/z/47o1jdnx8.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs