Why would this code not compile in VS2010?
struct Base
{
void foo0() { }
};
template<typename BASE> struct Derived : BASE
{
void foo1() { foo0(); }
};
int main()
{
Derived<Base> ddd;
ddd.foo1();
return 0;
}
It compiles just fine in other compilers. It also compiles if I call foo0 with the help of this: this->foo0();
I just figured out that the reason behind this behavior is Language Extensions compiler option (/Za). So if Language Extensions are disabled, above code would not compile. What is strange here is, this must be part of the C++ language and not the MS Language Extensions.
Hope this helps someone...