https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99201
--- Comment #4 from Matthias Kretz (Vir) <kretz at kde dot org> --- Manual reduction which fails with 8-11 and compiles ok with 7: template <class V, class... F> void test_values_2arg(F&&... fun_pack) { (fun_pack(V(), V()), ...); } template <typename TestF, typename RefF> auto make_tester(const TestF& testfun, const RefF& reffun) { return [=](auto... inputs) { auto totest = reffun(inputs...); using R = decltype(totest); auto&& expected = [&](const auto&... vs) { if constexpr (sizeof(R) > 0) return [&](auto i) { return reffun(vs[i]...); }(0); else return [&](auto i) { return reffun(vs[i]...); }(0); }; }; } template <typename T> T foo(T, T) { } int main() { test_values_2arg<double>(make_tester( [](auto... xs) { return foo(xs...); }, [](auto... xs) { return foo(xs...); })); return 0; }