The following program is incorrectly accepted by gcc. Demo: https://godbolt.org/z/rvfqzo5YW ``` template<typename T, typename... V> struct C { T v(V()...);; }; int main() { C<int> c; //works with gcc but rejected in clang C<int, double, int, int> c2; //same here: works with gcc but rejected in clang } ``` This is invalid because the construct `V()...` is actually equivalent to `V(),...`. So `V` is not expanded and this must be rejected.
The last statement in my original report is not valid because `V` is a template parameter pack. So ignore that line.
Also gcc rejects `V...()` but clang accepts that. Demo: https://godbolt.org/z/bfx9rv6hP
The correct behavior should be to accept `V...()` and to reject `V()...`.
*** Bug 107113 has been marked as a duplicate of this bug. ***
Note also that gcc accepts `T v(V...b())` but rejects `T v(V...())`. Note the use of parameter name in the former. Demo: https://godbolt.org/z/hMevdc8TE