annotate clang/test/PCH/cxx-friends.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-friends.cpp
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 class A {
anatofuz
parents:
diff changeset
4 int x;
anatofuz
parents:
diff changeset
5 friend class F;
anatofuz
parents:
diff changeset
6 };
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 namespace PR12585 {
anatofuz
parents:
diff changeset
9 struct future_base {
anatofuz
parents:
diff changeset
10 template<typename> class setter;
anatofuz
parents:
diff changeset
11 };
anatofuz
parents:
diff changeset
12 template<typename> class promise {
anatofuz
parents:
diff changeset
13 // We used to inject this into future_base with no access specifier,
anatofuz
parents:
diff changeset
14 // then crash during AST writing.
anatofuz
parents:
diff changeset
15 template<typename> friend class future_base::setter;
anatofuz
parents:
diff changeset
16 int k;
anatofuz
parents:
diff changeset
17 };
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 namespace Lazy {
anatofuz
parents:
diff changeset
21 struct S {
anatofuz
parents:
diff changeset
22 friend void doNotDeserialize();
anatofuz
parents:
diff changeset
23 };
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // Reduced testcase from libc++'s <valarray>. Used to crash with modules
anatofuz
parents:
diff changeset
27 // enabled.
anatofuz
parents:
diff changeset
28 namespace std {
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 template <class T> struct valarray;
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 template <class T> struct valarray {
anatofuz
parents:
diff changeset
33 valarray();
anatofuz
parents:
diff changeset
34 template <class U> friend struct valarray;
anatofuz
parents:
diff changeset
35 template <class U> friend U *begin(valarray<U> &v);
anatofuz
parents:
diff changeset
36 };
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 struct gslice {
anatofuz
parents:
diff changeset
39 valarray<int> size;
anatofuz
parents:
diff changeset
40 gslice() {}
anatofuz
parents:
diff changeset
41 };
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 }