Open
Description
#include <algorithm>
#include <iostream>
#include <iterator>
#include <list>
#include <string>
int main()
{
std::list<std::string> l1 = { "1" };
std::list<std::string> l2;
std::move(l1.begin(), l1.end(), std::back_inserter(l2));
std::cout << "l1: " << *l1.cbegin() << '\n'; // <--- should have a use-after-move
std::cout << "l2: " << *l2.cbegin() << '\n';
}
https://godbolt.org/z/Y96a6nv7h
https://en.cppreference.com/w/cpp/algorithm/move
Also not detected by bugprone-use-after-move
clang-tidy check: #137156