2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / pr85515-2.C
blob2b761bf9b929804a6aae22a34246e051732613df
1 // { dg-require-effective-target c++11 }
3 void test_1 ()
5   int arr[] = {1, 2, 3, 4, 5};
6   for (const auto v: arr) {
7     _forbegin; // { dg-bogus "suggested alternative" }
8     // { dg-error "'_forbegin' was not declared in this scope" "" { target *-*-*} .-1 }
9   }
12 int test_2 ()
14   int arr[] = {1, 2, 3, 4, 5};
15   int sum = 0;
16   for (const auto v: arr) {
17     sum += v;
18     __for_begin = __for_end;    // { dg-error "was not declared in this scope" }
19   }
20   return sum;