]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/range-for1.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for1.C
CommitLineData
f9132eb7
RRC
1// Test for range-based for loop
2// Test the loop with an array
3
4b2e63de 4// { dg-do run { target c++11 } }
f9132eb7
RRC
5
6extern "C" void abort();
7
8int main()
9{
10 int a[] = {1,2,3,4};
11 int sum = 0;
12 for (int x : a)
13 sum += x;
14 if (sum != 10)
15 abort();
16}
This page took 6.746998 seconds and 5 git commands to generate.