Variadic template works in gcc but not in clang
13:13 01 Oct 2022

I'm learning C++ using the books listed here. In particular I read about variadic templates. Now, to further clear my concepts I'm also writing simple examples and trying to understand them by myself using debugger and cout statements.

One such program that compiles with gcc but is rejected by clang is given below. Demo.

template 
struct C 
{
    T v(V()...);;
};
int main()
{
    
    C c; //works with gcc but rejected in clang 
    C c2; //same here: works with gcc but rejected in clang
}

So my question is which compiler is right here(if any)?

Here is the error that clang gives:

:6:12: error: '...' must be innermost component of anonymous pack declaration
    T v(V()...);;
           ^~~
          ...
1 error generated.
Compiler returned: 1
c++ templates variadic-templates