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
