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