https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78019
Bug ID: 78019 Summary: Local class with lambda in default member initializer cannot default-capture this Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: colu...@gmx-topmail.de Target Milestone: --- int main() { struct A { int x, i = [&] { return x; }(); } a{0}; } ----- > error: 'this' was not captured for this lambda function Making the default-capture `=' doesn't help, but explicitly capturing `this' works.