1 // PR c++/94546 2 // { dg-do compile { target c++20 } } 3 forward(T && t)4template <class T> T&& forward(T&& t) { return static_cast<T&&>(t); } 5 6 template <class X> test(X && plot)7void test(X&& plot) 8 { 9 // Note: For brevity, this lambda function is only 10 // defined, not called nor assigned to a variable. 11 // Doing those things won't fix the error. 12 [&]<class... T>(T&&... rest) 13 { 14 plot(forward<T>(rest)...); 15 }; 16 } main()17int main() 18 { 19 auto Plot = [](auto&&...) 20 { 21 }; 22 test(Plot); 23 } 24