// Header for PCH test cxx-friends.cpp class A { int x; friend class F; }; namespace PR12585 { struct future_base { template class setter; }; template class promise { // We used to inject this into future_base with no access specifier, // then crash during AST writing. template friend class future_base::setter; int k; }; } namespace Lazy { struct S { friend void doNotDeserialize(); }; } // Reduced testcase from libc++'s . Used to crash with modules // enabled. namespace std { template struct valarray; template struct valarray { valarray(); template friend struct valarray; template friend U *begin(valarray &v); }; struct gslice { valarray size; gslice() {} }; }