Intel® C++ Compiler - Missing diagnostic on a static data member of a template with no initializer

In previous Intel® C++ Compiler, no diagnostic message is issued when a const static data member of a template class is defined but not initialized. Now the Intel® C++ Compiler 10.X, 11.0 for Linux* or Windows* or Mac OS* will issue a diagnostic message.

For example.
t.cpp:
template <class T> struct A {
    static const int i;
};
template <class T> const int A<T>::i;
template struct A<int>;

Example with Intel C++ Compiler 10.0 for Windows:
>> icl -c t.cpp
Intel® C++ Compiler for applications running on IA-32, Version 10.0
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
t.cpp
t.cpp(5): error: const member "A<T>::i [with T=int]" requires an initializer
          detected during implicit definition of "const int A<T>::i [with T=int]" at line 5 of "t.cpp"
compilation aborted for t.cpp (code 2)

>>

Example with Intel® C++ Compiler 9.1 for Windows*:
>> icl -c t.cpp
Intel® C++ Compiler for 32-bit applications, Version 9.1
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
t.cpp

>>

 
Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.