Consider following program:
struct Test
{
virtual void foo()=NULL;
};
int main()
{ }
g++ 4.8.1 gives an expected error as following:
[Error] invalid pure specifier (only '= 0' is allowed) before ';' token
Clang gives following error:
error: initializer on function does not look like a pure-specifier
But when I tried it on MSVS 2010 it compiles & runs fine. I think g++ & clang is right in this case. What the standard says about this? I've disabled compiler extensions also using \Za command line option but MSVS still accepts that code. Why it isn't giving any error?
I also tried it on Online VC++ Compiler here that has been last updated on July 8, 2015. Is this really bug in MSVS 2010 & 2015?