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

    <tr>
        <th>Summary</th>
        <td>
            Deduction of template template parameter from template function parameter fails without `-frelaxed-template-template-args`
        </td>
    </tr>

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

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

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

<pre>
    Given

```cpp
template <template <typename> typename C, typename T> void f(C<T>) { }
template <typename, int = 0> struct S { };
int main() { f(S<int>{}); }
```

the trunk version of `clang++`, compiling with `-std=c++20`, reports:

```
<source>:3:14: error: no matching function for call to 'f'
int main() { f(S<int>{}); }
             ^
<source>:1:60: note: candidate template ignored: substitution failure: 
    template template argument has different template parameters than its corresponding template template parameter
template <template <typename> typename C, typename T> void f(C<T>) { }
                                                           ^
```

Passing `-frelaxed-template-template-args` prevents the compilation failure. Note that the trunk version of `g++` accepts the code with `-std=c++20` without the need of any additional flag.

[**live example on godbolt.org**](https://godbolt.org/z/zWMavoovP)

My understanding is that the code in this issue should be valid in C++17 -- shouldn't the `-frelaxed-template-template-args` be turned on by default when compiling in C++17 mode (or above)?

Thanks.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VFtvmzAU_jXk5SgRgVCaBx7apN1Tp0qttGeDD8GrYyNfaLNfv2NIIN2yqtqkIQPHPtfvXFxqfii-iA5VFG-j-Ob4vYqHVbXtcOJw30rmEKJ0844-tKjYHqP0Dk40bKJkM-2eA6_TgkMdJdcbUgonUbKGKL-ld3vBw8kq2RHK0dEW4mDGOuMrB0-jano7aAepPROKPJwsB29PZIxYwV9-G-STNalMTkeg5-hdg0B-1At0aKzQCnQNIRmSqV2U3IZFGhRbpfetkELt4FW4JsjMreMUbTWIJfFR0GCrjbNRenMxzcdturHamyokkyRTepcr-gAao00glCaQrmqCx9qryoXgam2gYlKC0xAlOcHO_ykncP5E2d3F4Jb0Utx9TA7Dv2KKCx4KOFZS7JQ2yAPX-tI64fwQMRPSm15rcjlqjQQzO79HAtEwC1zUNZqwG_ktM9QjjmoErmEKhLNUEWPQtppioRz9bnPU-V9tDX__TLm_1KWPzNqAMTRdbVCyN-TzE4aJoCRaEoHWIA25C6nCY9-y82Is4KsOiWqYgz8NwNT8wKoK29Eax48GoOdpP9hViDyYY-oAjHMRYmASasl2i3ezkZH-DS1JlxPgGyM8CBTKTvNSS7fQZjcIRBm18HXjXNvPV3JP653Q_Y_wfntgndbdY2j3Mz8PB_CKE0zHhp4RdkpCj0wooulUWOsRLCGRHEqEjkkqPnE3A9ZlDvP5kU8zlw8mPlkesue8USE3CsoDcKyZlw5eG1Rn18w7b_sQHUGn-Wel7rAf5PtzcM80Fi92MeNFytfpms1oBCUWW-R-uDuoEB_MCNRG76fz8cY5E6DmsWN9P4d15o0sfikXGfDlgnDSRsru9Ju3Rn_HytG2z74lIrtK83TWFJgnWYplucL1GuNyzfK0qrM4z6s44cu0nElWorRF30iJwtehgERTw8xEkcRJEufxaplmcZIv4mWe5dWyypL8mpF6tIqRLk-5CHGEPpqZog-p9IRiFUthnZ2YYRh31Nu9O7LPPKXEFJ1wThuhKY-oZ30ARQ_gJxTcTAs">