<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVM1y2yAYfBp8YaxRwLLsgw7-aSaX9pQXQPDZokFCFSiJ376LZDvJTC6depDFn5f9dhfX3lyqg--CNTTw2NjA6V21vSMmdyw_snzH1vncdN9fZ4S0nXajIc7kwfoQB1Itkz-uy9M3Jkcd-Q2k3M8djs-rt4afvGdiw8SWYy1Ek86TO-3HmEDROBPigRWHDm8m96w8fiB89CKBrIoTk3jpqVMt8WeMjtx28c7p344V3xybOnL_uULg81bZbsb7ps4df7__JI3fszvbO40PzPtBN73n4cGp7sz7AacFjlmBJ-N78I0Nce1hQmj86Ax4lJHXxJXW1EcyXEWunGPiwAP8gkTFPsEW-0QjS0oFVhyZeCymafQ2TYx9SJqIR7Ro2-C78xLOZ2cbm7HOLHg_YvzW491JKcu07wNPyCKJG9QlgKCaWU6mqFNExBL7mwrpVJyzzpfw6dMkb8cwVwIzdreFpTUYpWrUi5q3NOqVkNfeWW2ju_DQk7Yni9LvQqvhPLYE7bJU_hMNBJkCkENU-sW_0nBy_g0sEWHznQZf9mXat5j7g6fM17JYbyS6oixEXqa6s8_5mNjufnnUNPUAOd8w4ynMbqm-B-3okywpElMY79x_XmB-CM-f5Trwt8bqhgPG0VlN7tYIQyBqQ0KCbK1CKHwfre-Ug4Qb1RluqB9Iq2sukishuQKLKRlmO35gYo8m6msVC1NJs5VbtVBjbPxQPXl32TvIcVBxMQ6u-qrUNSGzRM693l7LfvC_SUcMbQhjCsljIfNtsWiqcnU60cpocapXYg09RQEtN-sHta612piFUzW5UKXoCtHRG58g0t0sjov_Z2ArkQuRP-RbGCgf8ixfFafS6JzyrRB6XbNVTrjkLks4mR_Oi6GaIOvxHLDobEC27ouwy547ookwGEbkEoOvoeedj_gHcAgU3Kgv36Q1-Ys76wd4lpJ9u9OLiX81kf8LQCC7vA>53095</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `.template` not followed by template arguments is incorrectly accepted
        </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>
    Consider this example:
```cpp
#include <iostream>

struct A
{
    void foo() {std::cout << "1\n";}
    
    template <typename T = int>
    void foo() {std::cout << "2\n";}
};

int main()
{
    A x;
    x.template foo();
}
```
Clang prints `2`. But the code shouldn't be accepted at all, since [`[temp.names]/5`](https://timsong-cpp.github.io/cppwp/n3337/temp.names#5) says that the name after `.template`/`->template` must be a *template-id*, aka must have explicitly specified template arguments. [Here's a stackoverflow thread](https://stackoverflow.com/q/70635683/2752075).

**Note**: this doesn't apply to `foo::template MyClassTemplate`, which is legal, but seems to be made optional (and deprecated at the same time) in C++2b.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU02TojAU_DXhkpLCREAPHATXmsvuaf5ACA_ITiAsCTr--30BxZktL2sFyQf069fdlKa6ZYXprapgpK5VlsKn6AYNhB9JdCLRkSTRMuQw3HcYV73UUwWU8EIZ60YQHeE_7sfzP25O0tEHSJovE4q_i1EVrY0hbE_YgeKZdZWvx4_STM6D4qCEsS2Jix7vhOckPT0RnjMHSFa4mYm7DdCLDug7rk5U9W7l9H9l2YuyfsLzrx0iPu2E6he8F30e6ef6il9_hivblcYTcy300HtZFlr0DR1GrGYp7jK8QpojX9cClQZNsK2ZdIU8UkdLoEJKGBxUVDgqtCasoBb9Qoni3MPGuacReqUsiU-EneN5G2f71rnBek3YGYdTnTV9s0Hnw0a5dipDhbzPuL4OeO8556l_7onHeOzFteJmkaBYWM6miNphxDz7hwq-KtZJog369GWTdpNdOkEzjo-Djapw5bsRH2J5pBUXwLwOWknl9I3aAaSqFba-Ci3GZuoAtQt9-28wAspkEdk6IT_MBcZamyuyxAhXrzT49lwoTYd7f_BKo4THyZ7jlKUxi1Lfd_g1HzPb4y-DPc0zhFy-sMqAXdwSw4C0nfGy-EjMYVy5_7yh-da-f5WroNdWyZYijIZGzO6WGAYL0FmPhLJ1AkNhBqdMLzRKuBd9RSsYRpDingvvivWuoMXgDVM9LQjLcbDy3kVQZbw68IMIHKoL2T_W0d44zLFGWRCzvL3Q3LPE5JkRK3t_HskMplFn32W-x2vRV-vL47YZRvMb38alsnbyCTvHPDrEQZvVYpvEUuxkxDnsk_12t61lWrPksNtxuUsCLUrQNvO5Z6yHK50h_IcdnwKVsYixaBsd0Du-jcJoF9dpJSOIDozJpCS7CPD71qHnEZqxCcZsplROjcVDrSzGaj1Ep1TTA8zlEF9MrjVj9mb0LdeYoUK4YK6fzfz_AvLhpeU">