Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

binding nondependent names issue in templates

Milind_Kulkarni__Int
New Contributor II
272 Views

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
272 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
0 Kudos
Milind_Kulkarni__Int
New Contributor II
272 Views
Hi Judy,

Thanks very much for considering it as a bug. Please provide a CQ number once you raise it.
0 Kudos
Judith_W_Intel
Employee
272 Views
Submitted as cq# DPD200153371

Judy
0 Kudos
Reply