https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67561
--- Comment #1 from Joel Yliluoma <bisqwit at iki dot fi> --- Further reduced example: template<typename PlotFunc> void DrawView(PlotFunc GetPlotFunc) { GetPlotFunc(1)(2); } void CalculateLightmap() { auto LightmapRenderer = [](unsigned round) { return [round](const auto& view) { return [=](auto prop) { round + 0; }; }; }; DrawView(LightmapRenderer(0)); } Replacing the [=] with [] or [&] retains the error. Replacing it with [round] removes the error.