The following Ansi-compliant code produces correct result for Microsoft* compilers (with /Za), but Intel C++ Compiler for Windows (with /Za) stillproduces wrong result. This behaviour difference between cl & icl compilers does not exist in a similar code that is posted in previous issue.
Please let me know what is the difference.
/////////////////////////////
[bash]#include#include #include using std::cout; using std::endl; void g() { cout << "global g()" << endl; } template class Y { public: void g() { cout << "Y<" << typeid(T).name() << ">::g()" << endl; } typedef int E; }; typedef double E; template class X : public Y { public: E f() { g(); return 0; } }; int main() { X x; cout << x.f() << endl; } [/bash]
Link Copied
For more complete information about compiler optimizations, see our Optimization Notice.