summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/lambda-pack-init1.C
blob: 89c63532831439d37d6f6c9e35bb83a035b2de49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile { target c++2a } }

void bar();
void bar(int);

template <typename... Args>
void foo(Args... args) {
  [...xs=args]{
    bar(xs...); // xs is an init-capture pack
  };
}

int main()
{
  foo();  // OK: xs contains zero init-captures
  foo(1); // OK: xs contains one init-capture
}