Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C

raw
1 // PR c++/94546
2 // { dg-do compile { target c++20 } }
3
4 template <class T> T&& forward(T&& t) { return static_cast<T&&>(t); }
5
6 template <class X>
7 void 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 }
17 int main()
18 {
19 auto Plot = [](auto&&...)
20 {
21 };
22 test(Plot);
23 }