<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115137>115137</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Analyzer warns about an uninitialized value on a structured binding captured in a lambda
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
KitsuneRal
</td>
</tr>
</table>
<pre>
In C++17, structured bindings could not be immediately captured in lambdas; in C++20 they can but Clang analyzer didn't seem to catch up with this. This small program:
```cplusplus
#include <tuple>
#include <iostream>
int main()
{
std::tuple<std::size_t> t{ 1 };
auto&& [a] = t;
[a] {
std::cout << a << std::endl;
}();
}
```
triggers an uninitialised value warning inside the lambda, as can be seen at https://godbolt.org/z/sPsW4Pnr4.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU92O2ywQfZrxzWgjG5zYvvBFfjbSp-9mVVXqZTUYYlNhHJlhV5unr0icVGlX8g_MGYbDOQyFYHtvTAvrHawPGUUeprn933KI3nwjl6lJf7b_edyD2IHYFRWIPQaeY8dxNhqV9dr6PmA3RafRT4zKoB1Hoy2xcZ_Y0fmWaj06GpWmAHKXZktNkSMPJiV6VJFx78j3SJ7c58XMqK32ICrGYMyIPGFH3A0Yz_hheUAebFjh98EGDCM5h-d56mcaQW4hP0C-hU1-e7qziyG9S1xI6zsXtUGQe45nZ0C-foXZKfBsUsk7fP1azziS9SBqEM2CVLvbAAPrREFul8r7RyDYi_nJIF-RodphgVAdQN7XISJFnkBsQGwQ1juC9QFBHpCfkh7Ivzt2U-TEG-Qe6T54oMZr91ypOixHuEdT5Fm725Rn2_dmDkgeo7fesiVng9H4Ti4a_KDZW9-j9cFqk1xdHE-XhsLNYZOM9EiMA_M5JFLiCOLYT1pNjlfT3IM4XkAcw1v4Ub75uVxlupW6kQ1lpi0qmde1LOsmG1qlTp1qmtKouixllRPVFelqLZtNflI5ZbYVuSiLIt_k9brOm1XRaVXK06nojK7rQkOZm5GsWzn3PqbNMxtCNG1RrAtZZY6UceHaH0J484FXFIRI7TK3adGLin2AMnc2cPhThi07027v1zhpE5BU8uZJvstDvskjfdFbTx1Ei6JZnF37l4CWh6hW3TSCOCYay-_lPE-_TMcgjlfyAcRxOd17K34HAAD__4l7O_g">