<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81307>81307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] -Weverything option produces a warning(-Wshadow-uncaptured-local) when explicitly capturing a local value using std::move()
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Wayonb
</td>
</tr>
</table>
<pre>
This bug is similar to https://github.com/llvm/llvm-project/issues/71976, except my scenario deals with move capture syntax.
This is a standard C++ pattern when moving objects into a lambda. Or is there something I am missing?
>From my repo, the warning only happens when ``-Weverything`` option is used and not when ``-Wshadow-uncaptured-local`` is used.
https://godbolt.org/z/6v1jbx5f1
```cpp
#include <utility>
void foo();
int main() {
foo();
return 0;
}
void foo() {
int* a = new int(1);
([a = std::move(a)]() {
*a = 2;
})();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2PozgQ_TXFpdSRsSHAgUPSWaQ97WWlORfYCR4ZG9kmH_vrVw70Tnp2-jInpHK998rl96AQ9MUq1UJ5hPKU0RJH59tv9HC2z3onHy2wE7DD36MO2C8X1AGDnrQhj9HhGOMcQByAd8C7i47j0u8GNwHvjLl-fN5m776rIQLvdAiLCsC7Km-qPfB3VPdBzRGnB4ZBWfLaoVRkAt50HHFyV4UDzXHxCsPDRrrv1ole5tIBCUMkK8lLfAd-BH7EmWJU3uJtVDbxaHtB16c5AmobHRIamnpJO8S_fCKJo0oqblJxTN1_Ik046RC0vYDoXnU776Y0s1ezS7eIo8IbefsUseaBI82zsmFVhz2DPXv7pq7KP57cawXdHLWzSXsJSiJZidbFz6AwknS3t8Vua5Bvxg1kNoYNui3lp_dwsncm7py_AO_-Ad7tr_n3_l6e89e7rEywZ8M8bxUutB3MIhWCeF-iNjo-QPzxiro6LfHsHPAaeAPi-HqobcSJtF0PEartFBF_gUlVr-LiLbIfRNXpa7nPjNpG4AckBHFCq25roc4_ayRkeVybQpRpS-KQ_AW8ptRann5FDvywYvgrV3VKiJ-u_t_EHwvNZCtkIxrKVJtXrCpZVed1NraczucyL8Rw7os9Fc25OJOo5J56yepyYJluOeMF46zJm0KIetdzUe9L4tRQKQdVQMHURNrsUsDSC2fPaLV1LliVGeqVCc9Ucz4YshfgPAXct89A9sslQMGMDjH8YIg6muevYEWUJ3y17IdZZ-_kMqiUuc3xwOuvbcqb1c7qPhs96GgeW54TJeGzCa9kFoVLCtr_3gZ4ky3etL__r3nu5N8AAAD__8ghfGA">