view 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
line wrap: on
line source

// 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);
}