#include
int main(void)
{
std::vector iv(100);
for(int i=0; i<100; ++i)
iv = i;
return 0;
}
When I try to compile I get the following:
icpc stltest.cc/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_uninitialized.h(225): error: identifier "__is_trivial" is undefined std::__uninitialized_fill_n<__is_trivial(_ValueType)>:: ^ detected during: instantiation of "void std::__uninitialized_fill_n_a(_ForwardIterator, _Size, const _Tp &, std::allocator<_Tp2> &) [with _ForwardIterator=int *, _Size=unsigned long, _Tp=int, _Tp2=int]" at line 1125 of "/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_vector.h" instantiation of "void std::vector<_Tp, _Alloc>::_M_fill_initialize(std::size_t={unsigned long}, const _Tp &) [with _Tp=int, _Alloc=std::allocator]" at line 266 of "/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_vector.h" instantiation of "std::vector<_Tp, _Alloc>::vector(std::size_t={unsigned long}, const _Tp &, const _Alloc &) [with _Tp=int, _Alloc=std::allocator]" at line 5 of "stltest.cc" /afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_uninitialized.h(225): error: function call is not allowed in a constant expression std::__uninitialized_fill_n<__is_trivial(_ValueType)>:: ^/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_uninitialized.h(225): error: type name is not allowed std::__uninitialized_fill_n<__is_trivial(_ValueType)>:: ^ detected during: instantiation of "void std::__uninitialized_fill_n_a(_ForwardIterator, _Size, const _Tp &, std::allocator<_Tp2> &) [with _ForwardIterator=int *, _Size=unsigned long, _Tp=int, _Tp2=int]" at line 1125 of "/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_vector.h" instantiation of "void std::vector<_Tp, _Alloc>::_M_fill_initialize(std::size_t={unsigned long}, const _Tp &) [with _Tp=int, _Alloc=std::allocator]" at line 266 of "/afs/glue.umd.edu/system/1.5/@sys/usr/local/gcc/4.6.1/bin/../include/c++/4.6.1/bits/stl_vector.h" instantiation of "std::vector<_Tp, _Alloc>::vector(std::size_t={unsigned long}, const _Tp &, const _Alloc &) [with _Tp=int, _Alloc=std::allocator]" at line 5 of "stltest.cc"
The references to the g++ header files seem suspect to me. Is it normal for icpc to piggyback off of the g++ installed on the system? If not, then does anyone know how to make it stop? On the other hand, if it is normal for icpc to include g++ STL headers, then does anyone have an idea what's going on here?Link Copied
For more complete information about compiler optimizations, see our Optimization Notice.