Issue |
137153
|
Summary |
`performance-move-const-arg` not reported for `std::move()` with range
|
Labels |
clang-tidy,
false-negative
|
Assignees |
|
Reporter |
firewave
|
```
#include <algorithm>
#include <iostream>
#include <iterator>
#include <list>
#include <string>
int main()
{
const std::list<std::string> l1 = { "1" }; // remove const
std::list<std::string> l2;
std::move(l1.cbegin(), l1.cend(), std::back_inserter(l2)); // use begin() and end()
std::cout << "l1: " << *l1.cbegin() << '\n';
std::cout << "l2: " << *l2.cbegin() << '\n';
}
```
https://godbolt.org/z/vxEGnbc9M
https://en.cppreference.com/w/cpp/algorithm/move
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs