Intel® C++ Compiler for Windows* - Compiler error on template redeclaration code

Symptom(s):

Code like the following:

namespace N {
    template< typename T > struct S {};
}
template< typename T > struct N::S;

Generates an error with the Intel® C++ Compiler:

template-redeclare.cpp(5): error: class template "N::S" may not be redeclared in the current scope
However, this same code is compiled by Microsoft Visual C++* 6.0 or Visual C++ .NET 2002 without errors.

Solution:
This issue is resolved in the Intel® C++ Compiler 10.0 for Windows*, only in Microsoft Visual C++* 6.0 compatibility mode (/Qvc6). Visual C++ .NET 2002 compatibility is not supported under 10.0. It is also recommended that such code be modified to avoid template redeclarations, as such code is non-portable to recent Visual C++ versions.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.