aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/range-for2.C
blob: acb16c57d1cb99211511537fb51a64d8fe4adbfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// P0614R1
// { dg-do compile }
// { dg-options "-std=c++2a" }

void
fn1 ()
{
  int a[] = { 1, 2, 3, 4, 5 };

  for (int i = 0; auto x : a)
    ++i;

  int i;
  for (i = 0; auto x : a)
    ++i;
}