Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel icpc unable to compiler <future> of gcc 4.7

woodbird
Beginner
514 Views

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
514 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.

0 Kudos
Hallo32
Beginner
514 Views

Hello,

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

0 Kudos
George_Z_
Beginner
514 Views

Same question, any update for this?

0 Kudos
asd__asdqwe
Beginner
514 Views

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

0 Kudos
Feilong_H_Intel
Employee
514 Views

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

Feilong

0 Kudos
Reply