Community
cancel
Showing results for 
Search instead for 
Did you mean: 
woodbird
Beginner
111 Views

Intel icpc unable to compiler <future> of gcc 4.7

Here is a minimal example, the problem seems to be related to lambda.

#include <future>

void say () { /* do nothing */ }

int main ()
{
auto handle = std::async(say);
handle.get();

return 0;
}

Here is the error message, I delete the "instantiation of ..." etc. messages 

/usr/include/c++/4.7/future(1453): error: invalid designator kind
_M_thread = std::thread{ [this] {
^

/usr/include/c++/4.7/future(1453): error: expression must have a constant value
_M_thread = std::thread{ [this] {
^
/usr/include/c++/4.7/future(1454): error: expected a "}"
_M_set_result(_S_task_setter(_M_result, _M_fn));
^
/usr/include/c++/4.7/future(1453): error: function "std::thread::operator=(const std::thread &)" (declared at line 144 of "/usr/include/c++/4.7/thread") cannot be referenced -- it is a deleted function
_M_thread = std::thread{ [this] {
^
/usr/include/c++/4.7/future(524): error: type name is not allowed
return _Setter{ __ptr, std::ref(__call) };
^

/usr/include/c++/4.7/bits/alloc_traits.h(56): error: expression must have a constant value
static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);
^
/usr/include/c++/4.7/bits/alloc_traits.h(201): error: incomplete type is not allowed
using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
^
/usr/include/c++/4.7/bits/alloc_traits.h(89): error: name followed by "::" must be a class or namespace name
typedef typename _Alloc::value_type value_type;

0 Kudos
5 Replies
Brandon_H_Intel
Employee
111 Views

Hi woodwind,

I can reproduce this too.  I've reported it to our front end team, and I'll let you know when more progress in the investigatino is made.  Thanks.

Hallo32
Beginner
111 Views

Hello,

are there any updates? I'm getting the same error with the icpc version 13.1.1.

George_Z_
Beginner
111 Views

Same question, any update for this?

asd__asdqwe
Beginner
111 Views

This doesn't compile with gcc 4.8.1 either, while it compiles fine with g++.

Feilong_H_Intel
Employee
111 Views

An update.  icc 14.0 supports gcc 4.7 & 4.8 now.

Feilong

Reply