https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70691
--- Comment #2 from cornelius.mika at gmail dot com --- Comment on attachment 38287 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38287 repro >template <typename F> >void demoError(int x, F f) >{ > const int y = x; > > auto lambda = [=](auto g) { > for (int i = 0; i < y; ++i) { > g(); > } > return 0; > }; > > for (int i = 0; i < 1; ++i) { > lambda(f); > } >} > >int main(int argc, char **argv) >{ > (void)argc; > (void)argv; > > demoError(1, [] { }); > > return 0; >}