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