<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113354>113354</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
cppcoreguidelines-rvalue-reference-param-not-moved false-positive for assignment operator?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
EugeneZelenko
</td>
</tr>
</table>
<pre>
I may be wrong, but looks like `cppcoreguidelines-rvalue-reference-param-not-moved` produces false positive when assignment operator with rvalue is available (https://en.cppreference.com/w/cpp/string/basic_string/operator%3D):
```
#include <string>
#include <vector>
std::vector<std::string> tokens;
void function(std::string&& token)
{
tokens.resize(tokens.size() + 1);
tokens[tokens.size() - 1] = token;
}
```
GodBolt: https://godbolt.org/z/9zhvr75db
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU0GPszgM_TXmYlGBQ0o5cJi2w2r_wl5WAUybbZqgJFDN_PoVLe3uzDeXT0JGjvPe80tiFYI-WeYa5B7kMVFTPDtfv08ntvwXG7YXl7Su_6j_xKv6wJbx5p09AR2wnSIa5y4Bjb4wwjbrxrFznk-T7tloyyH1szITp54H9mw7Tkfl1TW1LqZXN3MP2wxH7_qp44CDMoFxdEFHPTPezmzx0eCVbUQ3slfRebzpeMYHM-qAalbaqNYwAu3OMY4BxBtQA9Sw3XTj-FLfdO4K1NyAmm4cgZoQvV7MNK0Kuvv7lT6lgKQ4AlULYXaE7Bm32fo9UhLadmbqGUEcVhLx_lNx5m6hfRXvMcR-ERBvz-rhtfIiw-gubAOI_f-Rs9M9DpPtonYWaPcdR1ug7QO6uHggy5Vipdx4DvqTgXZrvmZAFQLtMb_7f2IQn53I_a_7U8xBHhHEcRV9tVsefz66e_zD9XtnIog3_Hp_J9e3zsSN88utfAI11ed59qXs26SvRV-JSiVc5yVVW8p2pUjOdVt2suhEQaUaZE7FrpJDMbSyFXKopORE15RRkWdE-S4vRL7ZiazPhchkXg0lCQVFxlelzcaY-bpoJzqEies8F0IWiVEtm3CfGKLOKHtKo-4_gAjoAET3Z5w-n_GyLI-JrxeytJ1OAYrM6BDDf_RRR8P1708PfpXCwfmfBgZEk0ze1N_OVsfz1K4jsbSy_tLRu3-4i0DN3XYAalbnc03_BgAA__97wVIn">