comparison gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
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 }