<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114803>114803</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][regression] clang can not distinguish similar class partial specialization with requires clause since clang 16
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wanghan02
</td>
</tr>
</table>
<pre>
Example code could be found below or on [godbolt](https://godbolt.org/z/o1Goex5vz). The code compiles fine with gcc, MSVC and clang 15. It fails with clang 16 onwards.
```
#include <concepts>
template <typename T1, typename T2>
struct S {};
template <typename TI, typename Tf>
requires std::same_as<TI, int> && std::same_as<Tf, double>
struct S<TI, Tf> {
using type = void;
};
template <typename TI, typename Tf>
requires std::same_as<Tf, double> && std::same_as<TI, int>
struct S<Tf, TI> { // since clang16: error: class template partial specialization is not more specialized than the primary template
using type = void;
};
static_assert(std::same_as<typename S<int, double>::type, void>);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE1v5DYM_TX0hdiBJdnzcfAhk8kUOfS0Qa8LWebYKmTJFeVkk19f2ON6ku42BVpg4NEH-chHUk8z29YTVVAeoTxlekxdiNWL9m2nfS6zOjSv1cN33Q-O0IRm-oyuwZrwEkY_LVx4wRAxeITy2IamDi5BeQK571IaGNQdyDPI83K1CbEFeX4DeQ7il0Dfy-c3kIcNPnVrhH6wjhgv1hO-2NRhawzIe_z162_3qH2Dxmnfoig3-Jjwoq3jq91yvsXgX3RseAP5CfK75bvNl991K5X1xo0NIah7E7yhITGoh_c-ifrB6TSbpNeBvO4Jn8SUzG0rVydOcTQJvyLsjrA7gTr-O9jjR7DLCoaR_hhtJEZOzVRGdce6p2-aQd1f3axPoB4Q5Bbk9qdml8msCWPt6IcsV5g56JzzNTAijmx9O6eFoE74HGxzY_O_mSF-Tu5j1p_xe1eGH8nNME-PCzm8ziGy9YauoyK2oO6QYgxxWhinmXElM-iYrHbIAxmrnX3TyQaPltGHhH2IdLuiBlOnPaaOcIi21_F1BfqvVeWkkzXfNDPFBHL_E_5rdSe-Uxk-dHs2nkym42uwB5CHW5i_XkTWVKo5qIPOqBI7le9ULkSZdRWZut7LralLo1Wh9aHJyz2JixG1kKrOM1vJXBZC5IUopCgOGxKiyfPdrjaXHRX1AYqcem3dxrnnfnr8mWUeqRKi2Ocqc7omx7P-SDn3BKScpChWk8OXemwZitxZTnyDSDa5WbSuHuUJymOkNhKzDR7K06IERvu5V43lZH07Wu6QbW-djkuz_6HHs5qsI2qcHpneDw6KbTZGV_1N4mzqxnpjQg_yPCW7_H0ZYvidTAJ5nskzyPPC_7mSfwYAAP__hY21-A">