<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/137157>137157</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`clang-analyzer-cplusplus.Move` not reported for usage after `std::move()` with range
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:static analyzer,
false-negative
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
```
#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';
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
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk8-O4ygQxp-mfEG2cOE_7YMP7vT6tg-wpxXGFZsdAhbgtHqefoWT6cz05DBSIgRFfVX8_JUMQS-WqIf6Feq3TO5xdb4_a0_v8krZ5OaPHhp-__EBUGirzD4TA3GSZnFex_UC4q_fgtqF6Ek-j0XyMjr_LGZ0iM_OQ_TaLvcIH7SN7CK1BXwB7NJZ-wp8YIyxEGcQA4jhJnX63H9KMFMyEG8M2lcGiCUgMmjfQLzexP9UBW8Zv1y_uCsBvpiymGj57A9PzJQF2fmx_8yYpPr2r7aBfCSfUvG40T1vR7k9Jh4gTql3U4IY2PGAH2eDKQv1U_FHpIX6ZNPye9tfZfGJLP6RbALJh59ds8a4hVQGR8BxcfPkTCycXwDH74DjP10jG3tt19tzf71OtlDb5ulMnqyiQrkL4PgOOKptAxwfJsTxYH9oDCY4Zl1kM0VSkWY2fTBo-LQvm3eW8j1QLs-RfH4kNZwpI-2SRz1_MLWS-nYDIErRlnWTzb2YO9HJjPqyreqqw6oW2do3LU31ROUkJaepmlHVZ1WLF941HVVlm-keOda8wqosOa9FMZVUdercNlROvFUIFaeL1KYw5npJVDIdwk79UbjNjJzIhGNCEY8eDw_KqBWTVpqP78k0CHgCxLM0gXJLi4w62RDTVPs-KefTvgSoeLJzeNSKOhpKM357_g_FXG1mD-lf_H3nk2h62pxPNM_Osz3IhdgBMaH9OgHJwQ1n7zquzEu7ULZ703_xgo7rPt2_aerpvuSbd_-RioDjASMAjnce1x7_DwAA___zyWBz">