1 // RUN: %clang_cc1 -std=c++2a -verify %s
3 namespace std_example
{
4 namespace std
{ template<typename T
> T
&&move(T
&); }
8 template <class... Args
> void f(Args
... args
) {
9 auto lm
= [&, args
...] { return g(args
...); };
12 auto lm2
= [... xs
= std::move(args
)] { return g(xs
...); };
17 template<typename
...T
> constexpr int f(int k
, T
...t
) {
18 auto a
= [...v
= t
] (bool b
) mutable {
21 return (__SIZE_TYPE__
)0;
23 return (v
* ... * 1) + sizeof...(v
);
25 for (int i
= 0; i
!= k
; ++i
)
30 static_assert(f(1, 2, 3, 4) == 3 * 4 * 5 + 3);
31 static_assert(f(5) == 1);
33 auto q
= [...x
= 0] {}; // expected-error {{does not contain any unexpanded parameter packs}}
35 template<typename
...T
> constexpr int nested(T
...t
) {
42 static_assert(nested(1, 2, 3) == 6);