<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66614>66614</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang frontend C++ crash with capture-default in concept
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
brutalsavage
</td>
</tr>
</table>
<pre>
To quickly reproduce: https://gcc.godbolt.org/z/1jYx7cocf (assertion-trunk)
```cpp
#include <concepts>
#include <type_traits>
template <typename A, typename C>
concept l = requires(A a, C c) {
{
[&](A& a) -> decltype(a += c){}
};
};
```
Compiling the above invalid code crashes clang `clang++ -x c++ --std=c++20 `, crashes locally using clang-17.0 (a10019a), also on trunk with assertion (see godbolt link)
Note: after removing the default capture (i.e., &), the code compiles correctly
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU02TqzgM_DXiooIydiDhwCEfk-Oe9rKnLWML4hkHM7bJTvbXvzIh8_HqVaWIDFK31S3JEMwwErVQHaA6ZXKOF-fbzs9R2iBvcqCsc_re_u3wfTbqzd7R0-SdnhWB2OMlximA2AM_Az8PShWD052zsXB-AH7-H_i5fP3nY6uc6hH4ToZAPho35tHP4xvwBtgJ2H591uzxU9O0vuHCjMrOmhDEUblR0RQDiJc_fY73if6NXprvGcsz0nWyMn5mjfJKiHvgR_w6Hj-LVh60COKEnt5n4ykA3-1RppojKuANwvbwyEfEn4flRXUAXkN1SnXA61TaYA7iBTUpm3iTIAj8kFgSYsLYnlaYFIkV80f8FOl7g0d3nYw144DxQig7dyM0401ao1E5Tai8DBcKqKwcB0wSpyBx8wPmH4n-EeYhahCn9cxZyk09PwGsU9LaO84hsS0oebkt2OJuyVjZpD5ThbTBoRtxcRr_M_GCn_an7ECE67igNcsw4Pee_nJxGTLZR_Lo6epuzwY19XK2EZWc4uwpoZmCisSaNH_wp8RH74s4qXnnPalo75jpVuhGNDKjtqybipXbTbPLLm3Pe9aUuqGKWKV0L6RoaLMVtea9bmqWmZYzLlhT7lhdlmJXNNu-3pWqK6teka4a2DC6SmMLa2_XtAeZCWGmtq7rcpNZ2ZENy8JxvnrA0-75NuXn3TwE2DBrQgxfCNFES-1x8a73bow0ajyuli3OPPRd9cif-pgR11nOZm_b39bVxMvcFcpdgZ8T1fqXT969korAz8vNA_DzcvlfAQAA__9Jj0K4">