https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62241
Bug ID: 62241 Summary: C++14 generalized lambda capture doesn't work with uniform initialization syntax. Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: 0xd34df00d at gmail dot com Created attachment 33386 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33386&action=edit Failing code Passing a lambda copying a value in its capture clause in a braced-init-list causes the compiler to issue `error: 'foo' was not declared in this scope`, where `foo` is the name of the copy. Important part is the error only happens if using the uniform initialization syntax. If the lambda is passed to a class ctor invoked via the standard '()' syntax, everything works fine. This is reproducible on 4.9.0 and 4.9.1 for me. I haven't had a chance to test 4.9.2 though.