|
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.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(R) 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(R) C++ Compiler for 32-bit applications, Version 9.1 Copyright (C) 1985-2007 Intel Corporation. All rights reserved. t.cpp
>>
This applies to:
|