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.
Fixed for GCC 8+.