* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for3.C
blobcc6deaf3b9f3ac9e706a174df8b11019c4f5450a
1 // Test for range-based for loop
2 // Test the loop with a custom iterator
3 // with begin/end in std
5 // { dg-do compile { target c++11 } }
7 struct iterator
9     int x;
10     explicit iterator(int v) :x(v) {}
11     iterator &operator ++() { ++x; return *this; }
12     int operator *() { return x; }
13     bool operator != (const iterator &o) { return x != o.x; }
16 struct container
18     int min, max;
19     container(int a, int b) :min(a), max(b) {}
22 namespace std
24     iterator begin(container &c)
25     {
26         return iterator(c.min);
27     }
29     iterator end(container &c)
30     {
31         return iterator(c.max + 1);
32     }
35 int main()
37     container c(1,4);
38     for (int it : c)    // { dg-error "was not declared" }
39     {
40     }