<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55549>55549</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Misrecognize lambda parameters as captures when used in requires expression
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
namniav
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/MKzEq9dsP
```c++
template<class T>
concept C = requires {
requires [](int a) { return a == 42; } (sizeof(T));
};
static_assert(C<char[42]>);
```
```
<source>:6:1: error: static_assert failed
static_assert(C<char[42]>);
^ ~~~~~~~~~~~
<source>:6:15: note: because 'char[42]' does not satisfy 'C'
static_assert(C<char[42]>);
^
<source>:3:31: note: because substituted constraint expression is ill-formed: variable 'a' cannot be implicitly captured in a lambda with no capture-default specified
requires [](int a) { return a == 42; }(sizeof(T));
^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVE1v4yAQ_TX4ghrZODjxwYc0SS-rSnvofcXHOGGFwQXcbvvrd3CSfqnblWoNNjAw8-bxsPT6qTumNEZSbwi7QTt4Lb1NCx8OOHrGdvvjeX_f6viTlDtSbs7vpjyZIuw62zybYBitSEDqrbIiRnpH6v3JpbxTMCa6paTe0QD3kwkQKVmdt9I3c_ya8B1ha-MSFYS1eRW60xQcFXl_DrFkpL5Gz47iymiewffYucPl2epzWPS_9ud3TCIZ9QvRQUi4Y5vBHkXArBgS8yLitwEuhX5a_XlYb6OfgoK8t9402CpsFELwIXfe5aS9MBb099DwPX37kNX-P_ZPgDwDcz4f1oZKUGKKgFSu3mVnK6o9HgmuoxGRxv4pr9li-xZ--h49_xxfnVv1Gb44yZhMmhJoioqKKYgsEvgzonCi8Y6aSI21V70PA3KMWx9EMELauTaRC1LC5XIkUINqNcok-4STI8oLo5osMSsGqQV9NOmIEC7OKw29mCwyMYIyvbmc4fel-5Vy6ZfPC3XVSWX0AA4CXj29-CDRQne1butWFEiche7WxADKHxwmvhQ6iiAGSBAiFfFSbqSPR3AUaZ9ZeanxlexiCvbj7wMpm-RC-QEH1j5cPldj8L9BoURuTIwTROxwzpdtcey4hF6WPfC2ZLqsJeuZrtqmKhvdg-B9YYUEG7tMLmMOHukcAvvIdWE6VjJW8mpdrnnFVgtogC9lo0rVrIGXnCxLGPDKLTKO_F8rQjdDktMhotOamOKrE6VsDg6gO51lIaZ09KFzYnBGPBRz6m6G_hc1u4Zr">