aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr85515-2.C
blob: 2b761bf9b929804a6aae22a34246e051732613df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-require-effective-target c++11 }

void test_1 ()
{
  int arr[] = {1, 2, 3, 4, 5};
  for (const auto v: arr) {
    _forbegin; // { dg-bogus "suggested alternative" }
    // { dg-error "'_forbegin' was not declared in this scope" "" { target *-*-*} .-1 }
  }
}

int test_2 ()
{
  int arr[] = {1, 2, 3, 4, 5};
  int sum = 0;
  for (const auto v: arr) {
    sum += v;
    __for_begin = __for_end;	// { dg-error "was not declared in this scope" }
  }
  return sum;
}