<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66999>66999</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Support capturing structured binding in OpenMP
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gonzalobg
</td>
</tr>
</table>
<pre>
Encountered trying to compile an HPC app that compiles fine with gcc and nvc++, but fails to compile with clang due to the following issue ([godbolt](https://clang.godbolt.org/z/oKf6esqhs)):
```c++
#include <utility>
auto test(std::pair<int, int> p) {
auto [x, y] = p;
return [&] {
return x + y;
};
}
```
with
```
<source>:5:16: error: capturing a structured binding is not yet supported in OpenMP
5 | return x + y;
| ^
<source>:3:11: note: 'x' declared here
3 | auto [x, y] = p;
| ^
```
cc @jdoerfert
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVNuK4zgQ_ZrySzHBluI4fvBDriwsyw7sF8hSxdagSF5dpjv99YOcpJOGQAth3U4dn9JxWYSgB0vUQb2Fel-IFEfnu8HZD2FcPxS9U5fuYKVLNpInhdFftB0wOpTuPGlDKCz-9XOHYpowjiLe9wOetCV803HEQUoUVqH9LYFt577DPkU8CW3CM9kMl0bYAVWifBJHwpMzxr3l9-oQEiGwNdTbwanemQj1Hth6jHEKwDfAjsCOM8PiBlg4PwA7fgA7ur9PKwr_jwFYmzvfQLmH8v5cldd-V3ndZVxbaZIiBL5LURsdL8AP11ORskYKEdg6RJUZ-WYS2gPfaRtzonngB5yAtQjNjRURcY6FevueUReo9wh8jxPwO8ZTTN5mCLDVfP4cntsN8Y7Atnh5REKz_1zk-df8npPON_7yEm5LvgsueUk5Y76pgW-qFfANkvfO54kUU0w-myMwRJ9kTPlD6bVVV8fQuogXihjSNDkfSaG2-O9E9p-fj2xqhGaH3-U1t2fgrUF9eKmXZ71VlmldpDwCa96BNahIGpGFjuTpwc4_2b9154WWh4xXVy0lwrL8pRz5E_mIheq4ankrCuqqVVuztmo4L8ZOkaJlWZKUy7JkaskUU31Vn8q1VLWQfaE7VjJetqyqSsYqvqj5cl01fdWceN0IRbAs6Sy0WRjz-5wLoJgrp1ut2rYtjOjJhLnoGbP0di0rYCz_A3yXY370aQiwLI0OMTxYoo6Guv-uRj5Z_8r4u8dF8qb7Wp-DjmPqF9KdgR0z-W34MXn3i2QEdpwlBWDHWfKfAAAA___xJFmB">