- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
[bash]#includeint main() { std::deque d; int a; d.insert(d.begin(), a); } [/bash]
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
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
/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
/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
compilation aborted for test.cpp (code 2)
Thanks in advance for your help.
IH.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to reproduce the problem and have entered this into our bug database as cq #174219.
We will try to fix it as soon as possible.
This is a bug in our new 12.1 support for the C++0x feature called variadic templates.
In order to revert to 12.0 behaviour you can add -U__GXX_EXPERIMENTAL_CXX0X__ to the command line.
This will turn off the usage of variadic templatesin the GNU headers.
Thanks for reporting it.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having exactly the same problem with gcc 4.7.2 and icpc 13.0.1. Is this problem solved? Is there a workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a workaround, you could try the suggestion earlier in the thread -U__GXX_EXPERIMENTAL_CXX0X__ if it doesn't disable other C++11 functionality you need, or look into the g++ include file where the error is reported to see if there is such a macro to disable the code which fails with icc. It seems the same macro is present up through g++ 4.8.
If someone had shown a complete test case, we could check it, e.g. on icpc 13.0.2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At my workplace we are planning to enable c++11 in the building environment but this bug is a show stopper. It happens to icc13.1 with gcc4.4.7 or gcc4.7.2. It works with gcc4.1.2 which doesn't have as many c++11 features. I don't have data point for any gcc version between 4.1 and 4.4 since we don't have any installed. I also cannot apply the workaround since it is needed in so many places in our code that the only sane solution is to undefine the macro globally. The defeats the original purpose of enabling c++11.
My conclusion is that icc is not ready for c++11. This would have been obvious to many others. The long life of this issue makes me wonder that I may have been using icc incorrectly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestions. I tried the following, it works.
value_type __x_copy = value_type(std::forward<_Args>(__args)...); // XXX copy
This line of code existed in libstdc++ for at least a year, at least since 4.4.7. So I think it is more like a icc issue than gcc. Can you help forward this issue to the responsible party?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page