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

    <tr>
        <th>Summary</th>
        <td>
            Regression in clang 16 `-frelaxed-template-template-args` support to alias templates.
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
template<typename T, int I = 0>
struct A {};

template<typename T, int I = 0>
using B = A<T, I>; 

template<template <typename> typename T>
void g() {}

void f() {
    g<A>();
    g<B>();
}
```

fails to compile on clang-16 (using `-frelaxed-template-template-args`) with the following error:

```<source>:12:5: error: no matching function for call to 'g'
    g<B>();
    ^~~~
<source>:8:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
void g() {}
     ^
```

The same code compiles on clang-15. Removing `-frelaxed-template-template-args`  makes that code fail in both clang 15 and 16 and also complains about `g<A>()` with the same error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2P4ygQ_TXlSymRDbHjHHxw0h1prqP-AwTKNrsYLMCd6Uv_9hV252N3NbujkSIZ8ahXj3oviBB0b4kaKI9QvmRijoPzzSiu12t2ceqjgSpff3KaIH-BvI00TkZEAn6KHxNZMRK-ATuhthG_IfAXzIG_rodD9LOM2CLsj7B_AX5c93-Dag7a9nhcdlvgp-XgtwTzI_6M9WuJTx2Av-JTtxv9u9MKe2A1sMNN7RPpAndP8LKLiNgDP7WJZsHuN7xBx39DD-rbcJ87dUKbgNGhdOOkDaGzKI2w_aaoEFi9zgGqfNN5MuIHqc3tmo-F8H1IvOyAVx0HjANh54xx11RM3jsPvH1u-9DCT8HNXtIy2rZgwNsSeHuvQutwFFEOiaqbrYzaWeycRymMScqB7Xtg-_8dRIKgfP38_PzS8PfWNfC2WhsmN1uUwiqtkp93Y3VvnSeVUG3fhdEK6cdktNTRfGzCRFJ3mhQK388j2bjovFdPwouRIvkk-e0u-adZwC_F_2Hf20AYUrSkU3TzMDyZWG7xO43u_dddRBzFnxQwDiKutCkjqC1eXBxWXixKFFZhUS0fYcIaICO0DSgubo6p2z_CWuWPeCyiF4-3mWq4OvCDyKgpqrqqOMvLOhuaXVfIetcd2EXWopOHel-WXCq1E6WiUu0z3bCc8bwqeL4rd0W9LS4HUe-JS64UMXmAXU6j0GZrzPu4db7PdAgzNRVndZEZcSETlteIMUtXXEBgLD1Ovkk1m8vcB9jlRocYHixRR0PNd-o9hZDyqO1tMNWvjjnM0-R8TAkWRotwz0nYZrM3zRDjFNLfhp2BnXsdh_mylW4Edk46vj6bybs_SEZg50V9AHZebvdXAAAA___7D6Bf">