Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Milind_Kulkarni__Int
New Contributor II
23 Views

binding nondependent names issue in templates

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]

/////////////////////////////////////////

Though the Intel C++ Compiler for Linux produces the correct result as intended.
0 Kudos
3 Replies
Judith_W_Intel
Employee
23 Views


yes, this looks like a bugsince Intel's /Za mode is notcompatible with Microsoft's /Za mode.
I will enter a bug report for this. Thanks for reporting it.

Judy
Milind_Kulkarni__Int
New Contributor II
23 Views

Hi Judy,

Thanks very much for considering it as a bug. Please provide a CQ number once you raise it.
Judith_W_Intel
Employee
23 Views

Submitted as cq# DPD200153371

Judy