aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/lambda-generic-variadic20.C
blob: ab1a4e42bd98fef2baaeb64f12713e44c44ee294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/94546
// { dg-do compile { target c++20 } }

template <class T> T&& forward(T&& t) { return static_cast<T&&>(t); }

template <class X>
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.
    [&]<class... T>(T&&... rest)
    {
        plot(forward<T>(rest)...);
    };
}
int main()
{
    auto Plot = [](auto&&...)
    {
    };
    test(Plot);
}