- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recently updated to Composer XE 2013 which claims to support GCC 4.7. But there are many problems. For example the simple example below, which triggers the move assignment operator
#include<vector>
int main () {
std::vector bar(10);
bar = std::vector(10);
return 0;
}
when compile on Linux with GCC4.7.1 installed as default GCC, it emits the following error,
$ icpc -std=c++11 -o foo foo.cpp
$ icpc -std=c++11 -o foo foo.cpp && ./foo
/opt/gcc/bin/../include/c++/4.7.1/bits/stl_vector.h(433): error: expression must have a constant value
integral_constant<bool, __move_storage>());
^
/opt/gcc/bin/../include/c++/4.7.1/bits/stl_vector.h(432): error: more than one instance of overloaded function "std::vector<_Tp, _Alloc>::_M_move_assign [with _Tp=double, _Alloc=std::allocator<double>]" matches the argument list:
function "std::vector<_Tp, _Alloc>::_M_move_assign(std::vector<_Tp, _Alloc> &&, std::true_type) [with _Tp=double, _Alloc=std::allocator<double>]"
function "std::vector<_Tp, _Alloc>::_M_move_assign(std::vector<_Tp, _Alloc> &&, std::false_type) [with _Tp=double, _Alloc=std::allocator<double>]"
argument types are: (std::vector<double, std::allocator<double>>, std::integral_constant<bool, <error-constant>>)
_M_move_assign(std::move(__x),
^
detected during instantiation of "std::vector<_Tp, _Alloc> &std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc> &&) [with _Tp=double, _Alloc=std::allocator<double>]" at line 7 of "foo.cpp"
compilation aborted for foo.cpp (code 2)
It seems to be a problem related to icpc's partial support of constexpr. The __move_storage above is defined as constexpr in the std_vector.h header, which shall be valid for template parameter.
Another problem I found earlier today is http://software.intel.com/en-us/forums/topic/326830
They both seems related to the constexpr issue. Undefine __GXX_EXPERIMENTAL_CXX0X__ solves the problem. Shouldn't icpc disable this macro by default for GCC4.7?
Link Copied
- 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
This issue has been fixed in the 13.0 update 1 and later.
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am using icpc 13.1.3 20130607. I see exactly same issue mentioned above. Does Intel fix it in 13.1.3?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page