1 // Test for errors in range-based for loops
3 // { dg-do compile { target c++11 } }
9 int *begin(const container &c)
14 int end(const container &c) //Ops! wrong type
27 explicit Explicit(int x)
34 for (int x : c) // { dg-error "inconsistent|conversion|comparison" }
40 for (Explicit x : a) // { dg-error "conversion" }
42 for (const Implicit &x : a)
44 for (Implicit &&x : a)
47 //Check the correct scopes
49 for (int i : a) // { dg-message "previously declared" }
51 int i; // { dg-error "redeclaration" }