* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for6.C
blobb4d9dd720ee61f2e374e1978d1cd484ac8404861
1 // Test for range-based for loop
2 // Test the loop with an initializer_list
4 // { dg-do run { target c++11 } }
6 #include <initializer_list>
8 extern "C" void abort();
10 template<typename T> T foo()
12     T sum = 0;
13     for (T x : {T(1),T(2),T(3),T(4)})
14         sum += x;
15     if (sum != T(10))
16         abort();
18     return sum;
21 int main()
23     int sum = 0;
24     for (int x : {1,2,3,4})
25         sum += x;
26     if (sum != 10)
27         abort();
29     foo<int>();