MSVC chokes in forward class template declaration

Viewed 88

MSVC fails to compile

#include <iostream>

template<int N, int = N>
struct A;

template<int, int V>
struct A{static constexpr int VALUE = V;};

int main() {
  A<1> a;
  std::cout << a.VALUE;
}

with (3): error C2065: 'N': unknown identifier (10): error C2975: 'V': invalid template argument 'A', constant expression expected (roughly translated).

clang compiles it silently.

So, the question: rotten code or demented MSVC?

MSVC version = VS 2019.

1 Answers
Related