<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVMFyozgQ_Rp8UdlFwCThwCHZ7FTNefcHhNSAJgKxkgjx3--ThDM4O5nLVlE2QurXr1-_VmvkpfnOBB8ZF9Y4x_ygHFsHpSm8Tq9q6hlvzeJZVpRVmT-Wpyx_yfKn7fc-T4-Y5-1LUapJ6EUSy8o_nLdAyMo_90H07slO7M0oyUSbFY_CTM4z52VWPuHZgor7rKiz8nkf6jz3SqTQDpHhRNp--DhXfwJibgdSx4QfJ0bzRmEdcGIylPkND5vJdsaOfBJ0DIeOkeOR2_6a7-WTAnuafw-o_j7_Dch9zlZup0APgluajfUkmZkgO6EhWpNlTkFFPuFz15F1jLNOvR-VZ94gJCDG05-rQSWnWzZIsUXyeSYOKCC0yGOsJeGZ6iKQGmdNI01BZDDh2hKXF0bvygVygUlkN_Cpp-ASMTBI3PdkKW1da1q5-0UtN6yel6_yxrIDQkokGXgLs2i8TFIJ7kPZ3H8Zimq58AvyXthqTXCw9oNZ-iEg7eVGd_7DkX2fErzgLum7SbdGClAN_k663dTzFxRFxEcPr62KgpF4BYmVX0DNuWUk97OEfbPD8EXGSVwsJ-OvkekwSDnDRn5pb9i54UovOUOe2NM860voRtLRsVZDQIiC5l_MYiFqStlyBKIdMxmoyUbVD37jmWh-GC9IixEpHO_gtOJqBQBKE_3xYwmTTDC6ZP1Czu0dg3YDo4WrXrfvZpyVjq270fJJo0QeRugX3g6zE1RZjY3XU6IbvsTkA38LQ8MIMwNrb93YjWIslYcM255WHXmFWk2yo2l_hMhYeVCHYpagKURhK2kd_weaYsmDWRHpsQI_NaUWJa2EmVXwL6YekxTwIwyKYLNBhFdcp8YntlDX0paQ3kksMOnpIJtS1mXND3yBjW3TKUsrqjwsVjeD97MLEsV7q1d-WNoTdMVC67fr33G2JhSFpUJfCRfet6o81_VhaKqcykf5kJ_PVcsrfq552daVpEdRi6qVdwfNW9KuyapntHyilUUIvGfVy-H_M1BNkRdFflfe3eV4q06VrHP-kLdVJ6U8C8rOOY1c6VPAORnbH2wTIduld9jUuJ7cz00YV_UTUSQMhl55Tc3Xd_HO2_-AVzAjbzUdIs0mcvwXXm1lVQ>53499</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
performance-move-const-arg fix-it is questionable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
I cam across this while thinking about #53083.
```cpp
#include <string>
extern void cb(const std::string&);
static void f()
{
std::string s;
cb(std::move(s)); // performance-move-const-arg
}
```
The `performance-move-const-arg` warning is reported on the caller side and offers a fix-it to remove the std::move().
This fix-it appears to be correct if the implementation already existed and the change which triggered the warning was on the caller side.
But if the implementation side was changed it could indicate that the implementation side is actually wrong although it is reported for the caller side. In that case the fix-it would be incorrect.
So based on the fix-it the check always assumes that the caller side is wrong which is not always the case so maybe the fix-it should be removed. Applying changes blindly to your code is bad but people might assume that a fix-it is a "safe" change to do and just second guess the change if it breaks the compilation.
Also a `std::move()` not working might not just have an effect on the performance but also on the lifetime of the object that is being moved as well as when and how often (in case it is copied instead of moved) potential side effects are being executed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VNFyozgQ_Br8orILQ0jCAw_JZbdqn-9-QEgDaCMQK4kQ__21JJzFuc1VUTZCmp6enh61Rl6aH0zwkXFhjXPMD8qxdVCawuv0qqae8dYsnmVFWZX5Y3nK8pcsf9p-7_P0iHnevhSlmoReJLGs_Mt5C4Ss_LYPondPdmJvRkkm2qx4FGZynjkvs_IJzxZU3GdFnZXP-1DnuVcihXaIDCfS9sPHufoTEHM7kDom_DgxmjcK64ATk6HM73jYTLYzduSToGM4dIwcj9z213wvnxTY0_xnQPX3-f-A3Ods5XYK9CC4pdlYT5KZCbITGqI1WeYUVOQTPncdWcc469T7UXnmDUICYjz9uRpUcr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