[Bug c++/58894] New: C++11 lambda doesn't take const variable by reference
abyss.7 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Oct 27 12:00:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58894
Bug ID: 58894
Summary: C++11 lambda doesn't take const variable by reference
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: abyss.7 at gmail dot com
Trying to compile this code:
===
const int a = 1;
auto lambda = [&]() {
&a;
};
lambda();
===
g++ gives error: lvalue required as unary ‘&’ operand
More information about the Gcc-bugs
mailing list