| Argyrios Kyrtzidis | 74d28bd | 2010-06-29 22:47:00 +0000 | [diff] [blame] | 1 | // Header for PCH test cxx-friends.cpp |
| 2 | |
| 3 | class A { |
| 4 | int x; |
| 5 | friend class F; |
| 6 | }; |
| Richard Smith | e85e176 | 2012-04-22 02:13:50 +0000 | [diff] [blame] | 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 | } |
| Richard Smith | 68ad0e7 | 2013-06-26 02:41:25 +0000 | [diff] [blame] | 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; |
| 40 | gslice() {} |
| 41 | }; |
| 42 | |
| 43 | } |