1 // Header for PCH test cxx-friends.cpp 2 3 class A { 4 int x; 5 friend class F; 6 }; 7 8 namespace 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 20 namespace Lazy { 21 struct S { 22 friend void doNotDeserialize(); 23 }; 24 } 25 26 // Reduced testcase from libc++'s <valarray>. Used to crash with modules 27 // enabled. 28 namespace std { 29 30 template <class T> struct valarray; 31 32 template <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 38 struct gslice { 39 valarray<int> size; gslicegslice40 gslice() {} 41 }; 42 43 } 44