blob: 8f50f2f2692841422fa40972bac9d4c48000a84c [file] [log] [blame]
Richard Smithad762fc2011-04-14 22:09:26 +00001// Header for PCH test cxx-for-range.cpp
2
3struct S {
4 int *begin();
5 int *end();
6};
7
8struct T { };
9char *begin(T);
10char *end(T);
11
Richard Smithb1502bc2012-10-18 17:56:02 +000012namespace NS {
13 struct U { };
Richard Smithad762fc2011-04-14 22:09:26 +000014 char *begin(U);
15 char *end(U);
16}
Richard Smithb1502bc2012-10-18 17:56:02 +000017using NS::U;
Richard Smithad762fc2011-04-14 22:09:26 +000018
19void 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
28template<typename A>
29void 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}