gcc/testsuite/g++.dg/cpp0x/range-for25.C
raw| 1 | // PR c++/57243 |
| 2 | // { dg-require-effective-target c++11 } |
| 3 | |
| 4 | struct snarf |
| 5 | { |
| 6 | template <class T> |
| 7 | void get() {} |
| 8 | }; |
| 9 | |
| 10 | template <class T> |
| 11 | struct container |
| 12 | { |
| 13 | snarf * begin() { return nullptr; } |
| 14 | snarf * end() { return nullptr; } |
| 15 | }; |
| 16 | |
| 17 | template <class T> |
| 18 | void foo() |
| 19 | { |
| 20 | container<int> arr; |
| 21 | |
| 22 | for( auto i : arr ) |
| 23 | i.get<int>(); |
| 24 | } |
| 25 | |
| 26 | int main() |
| 27 | { |
| 28 | return 0; |
| 29 | } |
| 30 |