Richard Smith | ad762fc | 2011-04-14 22:09:26 +0000 | [diff] [blame] | 1 | // Header for PCH test cxx-for-range.cpp |
2 | |||||
3 | struct S { | ||||
4 | int *begin(); | ||||
5 | int *end(); | ||||
6 | }; | ||||
7 | |||||
8 | struct T { }; | ||||
9 | char *begin(T); | ||||
10 | char *end(T); | ||||
11 | |||||
Richard Smith | b1502bc | 2012-10-18 17:56:02 +0000 | [diff] [blame] | 12 | namespace NS { |
13 | struct U { }; | ||||
Richard Smith | ad762fc | 2011-04-14 22:09:26 +0000 | [diff] [blame] | 14 | char *begin(U); |
15 | char *end(U); | ||||
16 | } | ||||
Richard Smith | b1502bc | 2012-10-18 17:56:02 +0000 | [diff] [blame] | 17 | using NS::U; |
Richard Smith | ad762fc | 2011-04-14 22:09:26 +0000 | [diff] [blame] | 18 | |
19 | void f() { | ||||
20 | char a[3] = { 0, 1, 2 }; | ||||
21 | for (auto w : a) | ||||
22 | for (auto x : S()) | ||||
23 | for (auto y : T()) | ||||
24 | for (auto z : U()) | ||||
25 | ; | ||||
26 | } | ||||
27 | |||||
28 | template<typename A> | ||||
29 | void g() { | ||||
30 | A a[3] = { 0, 1, 2 }; | ||||
31 | for (auto &v : a) | ||||
32 | for (auto x : S()) | ||||
33 | for (auto y : T()) | ||||
34 | for (auto z : U()) | ||||
35 | ; | ||||
36 | } |