150
|
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
|
|
12 namespace NS {
|
|
13 struct U { };
|
|
14 char *begin(U);
|
|
15 char *end(U);
|
|
16 }
|
|
17 using NS::U;
|
|
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 }
|