Code
template <typename T> struct Foo { int x_; int x() const; }; int a; template <typename T> decltype(a) Foo<T>::x() const { return x_; } int main() { }
throws the following error in Visual Studio 2013:
1>...\source.cpp(15): error C2244: 'Foo<T>::x' : unable to match function definition to an existing declaration 1> ...\source.cpp(6) : see declaration of 'Foo<T>::x' 1> definition 1> 'unknown-type Foo<T>::x(void) const' 1> existing declarations 1> 'int Foo<T>::x(void) const'
but compiles to Coliru GCC . In addition, it compiles in VS as a class without a template. I assume that this is due to the incompleteness of Visual Studio, and if this is true, I am sure that the reason for this already has its own name. I just can't find it with my messy terminology. What's happening?
source share