<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/145798>145798</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] Check request: modernize-use-auto-temporary
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
denzor200
</td>
</tr>
</table>
<pre>
C++23 suggests us the way to make a temporary copy of an object without creating a variable.
Need a check that fill find places in the code that mignt be improved using this new feature and will provide fixit hint to change that.
BEFORE:
```
void example(const auto& arg) {
const auto copy = get();
process(copy);
process(std::decay_t<decltype(arg)>{arg});
}
```
AFTER:
```
void example(const auto& arg) {
process(auto{copy});
process(auto{arg});
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykk0-PszYQxj-NuYwSkeFfOHAgm-TYSq96r4w9Afc1mNpDsuynr0xWm6166OGVkBjhx8_8xviRIZh-ImpEcRLFOZELD843mqYP5zFNk87ptXkTeBJ4wgzC0vcUOMASgAeCh1yBHYzyJ4EEpnF2XvoVlJtXcDeQE7juL1IMD8ODWxiUJ8lm6kHCXXojO0t7kba_EWmQoAZSP4EHyXAz1sLNTBpmKxUFMNPWUjlNT8Vo-omhIzDj7N2dNCwhOvNgAkz0gBtJXjyBnDQ8ol2UGU1wM--GYTATR3o1yKl_ekYUkbany_X3HxeRxVqU6eeTtndnNNC7HGdLAo_KTYFBLuwEliB9L7AGUZ1E2gK8Fp-nIbIz9MQCjwJrkT1Fs3eKQti85vW18PoeWEeOrNWk5Poni-xNk7K8zpHg2VNkF1GdYl2dvzxi_W96kbbt9Y_Lj1-b64W2CarTRv6t8X8V_0uW6CbTdVbLhJpDVaTHOj0UZTI0qsxJERbY5beuKg6ZLNWhI8RjjRnVOjENplikJRaIiFm5r3PKbyUds6KQxyovRJ7SKI3dW3sf9873iQlhoeaQF1V9TKzsyIbt-iMqK6d-x0avAjHGwTdx165b-iDy1JrA4eXDhu0WnG_bijO8bVfY098LBRZZC6PT5CfzQbsl0C4eye4rKMnibTMwzyH-FLwKvPaGh6XbKzcKvMZmn6_d7F1MksDrNkEQeP0c4t7gPwEAAP__rC0uGA">