Intel® C++ Compiler for Linux* - Implicit typename and named return value extension

For better compatibility with recent versions of the GNU* C++ compiler, the Intel® C++ Compiler 9.1 for Linux has removed support for "named return value" and "implicit typename" extensions.

One of the more significant changes in GNU* G++ 3.3 is the removal of the implicit typename extension. The extension was deprecated in G++ 3.2, and elicited a warning at every use. In a template class, names from dependent bases are not visible when the template is defined€”they are only looked up at instantiation time.

G++ had an extension that made names visible before instantiation, so G++ knew which were types and which were not. The standard requires that those that name a type be referred to using the typename keyword and qualified name.

The implicit typename feature is usually enabled in g++ mode, but should have been disabled in g++ mode when -gcc-version is >= 340. Having implicit typename enabled resulted in spurious errors when parsing nonclass template bodies. Now fixed.

The error message you would get looks like: " error: identifier "[xxx]" is undefined"

Example:
template <int i>
struct foo {
        typedef int a;
};

template <int i>
class bar : public foo<i>
{
        a b;
};

icpc -gcc-version=340 -c tst.cpp
tst.cpp(9): error: identifier "a" is undefined
              a b;
              ^
 
compilation aborted for tst.cpp (code 2)

while

icpc -gcc-version=320 -c tst.cpp  

should work.

The named return value extension has been deprecated, and is now removed from GNU* G++.

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.