summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/range-for9.C
blob: 96e9cb61fd6a199cc74461b318db348d466c613f (plain)
1
2
3
4
5
6
7
8
9
10
11
// Test for range-based for loop error in C++98 mode

// { dg-do compile }
// { dg-options "-std=c++98" }

void test()
{
    int a[] = {0,1,2};
    for (int x : a)  // { dg-error "range-based-for" }
        ;
}