http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60986
Bug ID: 60986 Summary: Wrong handling of const variables in lambda functions Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: physik3 at gmx dot net The code in the attachment compiles, but behaves in a strange way. Output is ==== a = 42 b = 0 b = 0 b = 42 ==== expected (and achieved if the function is not templated): ==== a = 42 b = 42 b = 42 b = 42 ====