I am learning C++ using the resources listed here. In particular, I have learnt that in C++20 we can have a class type as a non type template parameter. Now, to better understand the concept, I tried the following example that is accepted by msvc and gcc but rejected by clang. My question is which compiler is right?
struct Impl
{
constexpr Impl(std::initializer_list<int>)
{
}
};
struct Bar{};
template<typename T, Impl impl>
struct Foo
{
};
int main()
{
constexpr Foo<Bar, {1,2,3,4}> foo; //works in msvc & gcc but rejected in clang
return 0;
}