https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113375

            Bug ID: 113375
           Summary: GCC accepts invalid program involving template keyword
                    when used without a template arg list
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following invalid program(as per [temp.name#6]) compiles with gcc and
clang. https://godbolt.org/z/Yrj94haa4

```
template<typename T>
struct C
{
     template<typename U> void func(U)
     {

     }
};
int main()
{
    C<int> c;  
    c.template func(5); //this is invalid as per current wording gcc and clang
accepts but msvc rejects     
    //c.template func<>(5); //valid as per current wording. All compilers
accepts this
}

```

Reply via email to