Consider the following demonstrative program.
#include <iostream>
namespace N
{
struct A
{
static int n;
};
A A;
}
int N::A::n = 10;
int main()
{
std::cout << N::A::n << '\n';
std::cout << N::decltype( N::A )::n << '\n';
return 0;
}
The program compiles successfully using gcc 8.3 at for example www.ideone.com.
However if to run this program using MS VS 2019 then the compiler issues an error relative to the record decltype( N::A )
in the nested-name-specifier. If to remove preceding name N::
then the program compiles successfully.
Is it a bug of the MS VS compiler or is the nested-name-specifier written incorrectly?