<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96408>96408</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Cannot use lambda expression within Requires
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Fedr
</td>
</tr>
</table>
<pre>
This program
```
template<typename T>
concept C = requires(T t) {
[x=t](){ return x; }();
};
static_assert(C<int>);
```
seems valid, and it is accepted by GCC and MSVC. Unfortunately, Clang rejects it with the
```
error: constraint variable 't' cannot be used in an evaluated context
3 | [x=t](){ return x; }();
```
Online demo: https://gcc.godbolt.org/z/37v5bWKvv
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycUsuO2zgQ_JrWpTEGTVqWdNBhLK_2sFgssJkkx6Al9dgMKNIhWxo7Xx_IdjKZIKcAgvgoVnexWJSSPXjmGvId5PuMJjmGWLc8xKwLw6V-OtqEpxgOkUZQe1CPsFX377oUHk-OhME0cjmxp5HxCcxfN7QPvueTYINg9hj5y2QjJ9DlEwroCqHY3Q4iIkK-O4PZC-R70CXoCoodRpYpejyD2SEU3wFzpy07P-bXfxIS23-ilDgK6LIB01gvi6KfeW8vkZjHhDM5O4BukPyAVtAmpH6RzwN2F_y7uSH_vvvQrPC9fw5RJk_C7rKQGkf-gJE_cy9pob9YOaIc-bcdOcYQwTxiH3ySSNYLzhQtdY4RdCGgC-zJ-yDYMU6JB7QeySPP5CZaNPXBC5_l1UCDUDT4p1a-Ffifd9YzDjyGReZR5JTAPIJuQbeHvl8dwtAFJ6sQD6Dbr6BbU8x59_Gfec6G2gyVqSjjel2sK1Wpcl1mxzrvVTVsu0rpgvutetZMxZqqDW23eaefu8zWWumN2mqt12tjylWpjVnnikhtClUaho3ikaxbOTePS-_MpjRxXW03qswcdezSNcxae37BKwhaL9mO9cJ56KZDgo1yNkl6rSJWHNfNzfApMToau4GQz6fIKdngr-9pPf5_D3E2RVf_YouV49St-jCCbpfS9-HhFMMSC9DtVVAC3d4Ez7X-FgAA__9yqQvY">