annotate clang/test/PCH/cxx-for-range.h @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Header for PCH test cxx-for-range.cpp
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 struct S {
anatofuz
parents:
diff changeset
4 int *begin();
anatofuz
parents:
diff changeset
5 int *end();
anatofuz
parents:
diff changeset
6 };
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 struct T { };
anatofuz
parents:
diff changeset
9 char *begin(T);
anatofuz
parents:
diff changeset
10 char *end(T);
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 namespace NS {
anatofuz
parents:
diff changeset
13 struct U { };
anatofuz
parents:
diff changeset
14 char *begin(U);
anatofuz
parents:
diff changeset
15 char *end(U);
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17 using NS::U;
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 void f() {
anatofuz
parents:
diff changeset
20 char a[3] = { 0, 1, 2 };
anatofuz
parents:
diff changeset
21 for (auto w : a)
anatofuz
parents:
diff changeset
22 for (auto x : S())
anatofuz
parents:
diff changeset
23 for (auto y : T())
anatofuz
parents:
diff changeset
24 for (auto z : U())
anatofuz
parents:
diff changeset
25 ;
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 template<typename A>
anatofuz
parents:
diff changeset
29 void g() {
anatofuz
parents:
diff changeset
30 A a[3] = { 0, 1, 2 };
anatofuz
parents:
diff changeset
31 for (auto &v : a)
anatofuz
parents:
diff changeset
32 for (auto x : S())
anatofuz
parents:
diff changeset
33 for (auto y : T())
anatofuz
parents:
diff changeset
34 for (auto z : U())
anatofuz
parents:
diff changeset
35 ;
anatofuz
parents:
diff changeset
36 }