gcc/testsuite/g++.dg/cpp0x/range-for30.C
raw| 1 | // PR c++/54430 |
| 2 | // { dg-require-effective-target c++11 } |
| 3 | |
| 4 | struct A |
| 5 | { |
| 6 | A(int) {} |
| 7 | int* begin() {return nullptr;} |
| 8 | int* end() {return nullptr;} |
| 9 | }; |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | int i[] = { 1, 2, 3, 4 }; |
| 14 | for (int i : i); |
| 15 | for (auto i : i); |
| 16 | for (A v : v); // { dg-error "not declared in this scope" } |
| 17 | } |