aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/lambda-generic-vla1.C
blob: f646b85b5b076371c9fe617f881c6dc13a3bc9ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/59271
// { dg-do compile { target c++1y } }

extern "C" int printf (const char *, ...);

void f(int n)
{
  int  a[n];

  for (auto& i : a)
    {
      i = &i - a;
    }

  [&a] (auto m)
    {
      for (auto i : a)
	{
	  printf ("%d", i);
	}

      return m;
    };
}