// PR c++/94546 // { dg-do compile { target c++20 } } template T&& forward(T&& t) { return static_cast(t); } template void test(X&& plot) { // Note: For brevity, this lambda function is only // defined, not called nor assigned to a variable. // Doing those things won't fix the error. [&](T&&... rest) { plot(forward(rest)...); }; } int main() { auto Plot = [](auto&&...) { }; test(Plot); }