In building our code with ICC 12.1, we are getting a compiler error with the GCC header file for deque. The problem does not occur with ICC 11 and does not depend precisely on gcc 4.5.3.
icpc version: icpc (ICC) 12.1.0 20110811
gcc version: 4.5.3
command line: icpc -std=c++0x -o test test.cpp
Test code:
#include
int main()
{
std::deque d;
int a;
d.insert(d.begin(), a);
}
These compiler errors are generated:
opt/gcc-4.5.3/bin/../include/c++/4.5.3/bits/deque.tcc(512):
error: expected a ")"
value_type
__x_copy(std::forward<_Args>(__args)...); // XXX copy
^
detected during:
instantiation of
"std::_Deque_base<_Tp, _Alloc>::iterator std::deque<_Tp,
_Alloc>::_M_insert_aux(std::_Deque_base<_Tp, _Alloc>::iterator, _Args
&&...) [with _Tp=int, _Alloc=std::allocator, _Args=
int &>]" at line 136
instantiation of
"std::_Deque_base<_Tp, _Alloc>::iterator std::deque<_Tp,
_Alloc>::insert(std::_Deque_base<_Tp, _Alloc>::iterator, const _Tp
&) [with _Tp=int, _Alloc=std::allocator]" at line 13 of
"test.cpp"
/opt/gcc-4.5.3/bin/../include/c++/4.5.3/bits/deque.tcc(136):
error: expected a ";"
return _M_insert_aux(__position,
__x);
^
detected during instantiation of
"std::_Deque_base<_Tp, _Alloc>::iterator std::deque<_Tp,
_Alloc>::insert(std::_Deque_base<_Tp, _Alloc>::iterator, const _Tp
&) [with _Tp=int, _Alloc=std::allocator]" at line 13 of
"test.cpp"
/opt/gcc-4.5.3/bin/../include/c++/4.5.3/bits/deque.tcc(136):
error: expected a "}"
return _M_insert_aux(__position, __x);
^
detected during instantiation of
"std::_Deque_base<_Tp, _Alloc>::iterator std::deque<_Tp,
_Alloc>::insert(std::_Deque_base<_Tp, _Alloc>::iterator, const _Tp
&) [with _Tp=int, _Alloc=std::allocator]" at line 13 of
"test.cpp"
compilation
aborted for test.cpp (code 2)
Thanks in advance for your help.
IH.




