template <typename Type, Type Func>
struct A
{
};
void func();
A<void(), func> a; // same result with A<void(), &func> a;
This code compiles with Clang (including latest 8.0.0), but not with GCC (including latest 9.1).
GCC says: error: 'void()' is not a valid type for a template non-type parameter
Which compiler is right and why?
Update
I am guessing GCC is wrong, because the following compiles on both Clang and GCC:
template <void()>
struct A
{
};
void func();
A<func> a; // same result with A<&func> a;
So contrary to what GCC reports in the first example, void() seems to be "a valid type for a template non-type parameter"