Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7680 Discussions

C++0x copying lambdas causes backend signal

Cameron_Buschardt
197 Views

<class T>
function<
void ()> test() { return [] () {}; }

int main(int argc, _TCHAR* argv[])
{
test<
int>();
}

0 Kudos
1 Reply
Judith_W_Intel
Employee
197 Views

The test case you wrote above is illegal since you the function class was never declared.

Inboth 11.1 and 12.0on Windows I see this validerror:

!% icl /Qstd=c++0x -c t.cpp
Intel C++ Compiler XE for applications running on IA-32, Version 12.0 Beta Bu
ild x
Built Mar 29 2011 23:08:17 by jward4 on JWARD4-DESK in D:/workspaces/12_0cfe/dev

Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

t.cpp
t.cpp(3): error: expected a declaration

^

t.cpp(11): warning #12: parsing restarts here after previous syntax error

compilation aborted for t.cpp (code 2)

Please provide more details, like what version of the compiler you are using and what the actual code looks like. I know there were some lambda bugs in version 11.1 but I don't know of any in 12.0.

thanks
Judy

Reply