aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/lambda-init1.C
blob: 252546414199fffa083f2243cef940a8871a2caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// N3648: capture init
// { dg-options "-w" }
// { dg-do run { target c++1y } }

int main()
{
  int x = 41;
  auto r = [x = x+1]{ return x; }();
  if (r != 42) __builtin_abort();

  static auto *p = &r;
  [&x=r]{ if (&x != p) __builtin_abort(); }();
}