<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58896>58896</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [16 regression] Partial specialization with constrained parameters declared in wrong order is suddenly "not more specialized"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          HolyBlackCat
      </td>
    </tr>
</table>

<pre>
    ```cpp
template <typename A, typename B>
concept C = sizeof(A) > sizeof(B);

template <typename A, typename B>
struct X {};

template <typename B, C<B> A>
struct X<A, B> {};
```
Clang 15 accepts this, but trunk says:
```none
<source>:8:8: error: class template partial specialization is not more specialized than the primary template [-Winvalid-partial-specialization]
struct X<A, B> {};
       ^
<source>:5:8: note: template is declared here
struct X {};
       ^
```

Desugaring this to `template <typename B, typename A> requires C<A, B>` has no effect, the error is still there.

But further fixing the parameter order to `template <typename A, typename B> requires C<A, B>` fixes the error.

Tested at trunk commit `129177eaf0ecb202a6f44ab8d23ad51fe00d15f6` with `-std=c++20`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVEtzmzAQ_jXiorFHCIPhwMHYyfTYQ2faq0CLUSMQlURS59d3BbGd92TqwRLax7ffPkRt5KkkGVueZhwJOxC289CPWnigJNn70wiD6IHuCN_Ty6kiyc1i3JihgdHTPVofqFOPYFrCczQvUHJzlVQoIUm1eP1HIOft1Hj6i5JtRbaHr0BVAWqPkoCCwK-hUDNHm9WvYc9lWY57LYYjjVMqmpCuo75TLvjWk6cIN9xRJ06OJLtX7oMZ4EmU7J2ZbAOBR7LLn_4UrDU2vDRaOAQ-ZzIK65XQ1I3Q4K4ehVdmoMrRwXjaGwtXFUgkJAZc0M-qXtjTFYik1eqnGu7RUK6eUFcvUUl6-Hpp6PIj6c27iaXnxJAmhP1CBKlLwCwt0u3AwueNfRPmZUeW9QBuOgqrsDmhI9QbihYfT8OzMcPELPyZlAU3D8klXwSgnQhlptC20PjZESs7dypk4bzSOogsrJ-zqXAY2skGBW3V34XV3EkM6VForMT1E5Jvp_8TkhgC3JXZCyo_wHksszhPZ2P6XvkQN-ZFvN2CaBk0NWdcZO1mI-pc8kTING6BMRmnbRYiPCjfBZ-V8xLvd0M4VrHioQvrCMo4y7ZFkfOYRbJMZJEUIvLKayhx5uIMqR-RuFsGjH5_f6DnGPgZwTkQakDOl3I9GxeFdtZgPZcKhh5MUsKgT5Rw_t6FQHE0WV123o_zveS3-Bwx2FSvsRp40Pr-vK1Ga37Prb5Vzk2Ad_s2zfMii7oyb_MtzwvOWZbLetOkMq0Llmcc0jhhySbSogbtQs6BCzzQGQLfMetIlVhjHsesiHnKYraWMa7A8lyILYoZ2TDohdLrwGNt7DGy5Uypno4OlVo5765K_Eao4wBziQO-mHxnbPnN6FOlRXO3Fz6a45cz_3-tIszi">