Open
Description
Given this code:
struct A {
A(A &&) = default;
A &operator=(A &&) = default;
};
A f(A &&a) {
return a;
}
Even in C++20, Clang-Tidy says:
<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 is not fully implemented in this check.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
llvmbot commentedon Mar 21, 2025
@llvm/issue-subscribers-clang-tidy
Author: None (MagentaTreehouse)
A f(A &&a) {
return a;
}
Seems like P1825 is not fully implemented in this check.
See https://compiler-explorer.com/z/47o1jdnx8.