<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/161983>161983</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Variadic concept defined in terms of another concept improperly cached
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidstone
</td>
</tr>
</table>
<pre>
The following valid translation unit
```c++
template<bool b>
concept bool_ = b;
template<typename... Ts>
concept unary = bool_<sizeof...(Ts) == 1>;
static_assert(!unary<>);
static_assert(unary<void>);
```
causes clang to fail with
```console
<source>:8:15: error: static assertion failed
8 | static_assert(unary<void>);
| ^~~~~~~~~~~
<source>:8:15: note: because 'void' does not satisfy 'unary'
<source>:5:17: note: because 'sizeof...(Ts) == 1' does not satisfy 'bool_'
5 | concept unary = bool_<sizeof...(Ts) == 1>;
| ^
<source>:2:17: note: because 'false' evaluated to false
2 | concept bool_ = b;
| ^
1 error generated.
Compiler returned: 1
```
Commenting out either static assert causes the failure to go away. This was introduced by 9583b399d85cacdfa0a41f798ab44abaa3981bbf @cor3ntin @zyn0217
See it live: https://godbolt.org/z/r5nPr5TKe
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE2P4ygQ_TXkUhoLgx3bBx_c6cllLytttNdRGcoJKwIR4LTSh_3tK-zunum0urXSICRb1KtXrz4AYzRHR9Sz-oHVjxuc08mHXuPV6Ji8o83o9a0_nAgmb61_Mu4IV7RGQwroosVkvIPZmcT4kPeWr1sx8ZA3HxKdLxYTMbkbvbcwMvmd8UF5p-iSIJ_9ACYfs-FhZfnFJd0u5PBMRVHAIb53nR2G2-qaSZjcRfNMfiqKgon2EJnosjUDyuz5Sh8TJqN-YIwUEhMtE-VCxeQuw0S3Iu9hr5irN_pX3FvOWRrOkSIoi-4IycOExsKTSaf78ngXvaV8JHfRz0HRonBomRzKmskBKAQf8s-qA1YdudyZlDTjAwBAC6zZwf_VCsvKHqz-_u_b-kqH87kRA4y0JAdMNAuraEB7itkOEZOJ0y3b1sii-UiZ2crmE8ovOvdJoLXnS6CcU71k9Vuj8a44H_WLr_RPaCNlqXRFO2MivbY_n67M4p3AD2P_M_j9WsWU60DAkRyFzF8wPuz8-WIsBQiU5uBIZ1Xl3UyuuDO5lG-vnxOQSScK7wcLXkY35buOxs6BcgZHD_iEtwIOJxPhCSMYl4LXsyIN4w26upWj7Drd1gqVnpBjVU5N1-JYVTgiyq4tx3ECVnHlg8wi8v_zzXFRNrDq-4sITAJrrktdTyldIpMDE3sm9kevR29T4cORif0zE_tQuz9DffiDNrqXupMdbqgvm7rbCrkVYnPqcYtKju3U1aWoJiVHtSVdNbrmZUd11WxML7ioS85rzgUXokBsxLYcsapqKdqKWMXpjMYW1l7POfbGxDhTX27LrpUbiyPZuLybQizXnQmRn9DQZ4dv43yMrOLWxBR_UiST7PLYrh71I_yNwaA26m0wNE3GkQbjIFE4R_AToPNLw14x5nwJ_kLB3kChOpHezMH2d1Uz6TSPhfJnJvZZwMvn2yX4f0glJvZLQpGJ_UtO1178FwAA___D49jC">