<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61811>61811</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang type substitution for concepts is too eager
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++20,
clang:frontend,
rejects-valid,
concepts
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
GCC test `concepts4.C` fails when it should pass. Apparently this part of [temp.constr](http://eel.is/c++draft/temp.constr#normal-1.4) points out that the type substitution happens later than when we're applying it (cc @zygoloid in case I botched the explanation).
```cpp
template <class T> struct A { static const int x = 42; };
template <class Ta> concept A42 = A<Ta>::x == 42;
template <class Tv> concept Void = __is_same_as(Tv, void);
template <class Tb, class Ub> concept A42b = Void<Tb> || A42<Ub>;
template <class Tc> concept R42c = A42b<Tc, Tc&>;
static_assert (R42c<void>);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8k0Gv2zYMxz8NfSGeYVNOHB98SJxm2HXodg1kWYlVKJYh0mmzTz_IeX0NhrZAoBik-CP_Iv6a2V0na1vYHGBzzPQiY4it-TL0WR-GR_tH16FYFoRtYcJk7Cxc5R1sC7xo5xm_jnZCJ8hjWPyAs2bOcT_POtpJ_ANldIyzjoLhgrA5iL3NuQkTS4TNEWg3isyg9kAnoJO1PncMdDJAB6DDEPVFgE6vVaSmEG_av5V5BdTgHNwkjGERlFGnw6I8Zou89CxOFnFhwlHPs50YvRYb08XpOfpXC1RHi3qe_cNN16QFaGcMQlX8-7gGH9yAbkKj2eKf2Acxox3WLvbb7PWkEx-oyaE4QrGHbfH8mXl-RtLwqS2C6ozXzPgZ1CdkiYsR3CPUB2TR4gyuEtFNgt8Q1BErAnVAqI-gDu_4XyF1Yr6vCPcVrfV7UN2aSS-s9iv0g_tL1P0V9U_Sn2rOZ8dn1jd71gy0-3wH6vAe3ADU_I7Wp3vP77_7_w3Zr-TUIg26ZqHuoO5SElS3FvwObl6Bf1VknrIr6hPQpNbp3L5inufzxc-a2cZ15akaVLcqUp9eRX2sNBtaNTSq0Zlty-2uKMumbJpsbHdVXdZqWzR6Q6bc1L1uyosmVSvaNaofMtdSQapQ1JRNtVVNXlK5Gy7VxfRFYUqzgaqwN-187v39lod4zRzzYtttuSvLzOveel5dSvTuDSqACKhLEa-nK6j9JYZJ7DR8JKL9Yo3w21179yP63cgpsDlmsU093_rlylAV3rHwjynEibdtlxr8xFWXEL-_PqNjlBDQ6quN2RJ9m6zNH96-OhmXPjfhBnRK_Pe_tzmGNCXQaZWc7L-q_i8AAP__14Nqew">