Debian Codegraph @

gcc/testsuite/g++.dg/modules/pr99283-6_b.H

raw
1 // { dg-additional-options {-std=c++2a -fmodule-header} }
2 // { dg-module-cmi {}
3
4 #include "pr99283-6.h"
5
6 template<typename _Tp>
7 void __addressof(_Tp& __r) ;
8
9 template<typename _Tp, _Tp __v>
10 struct integral_constant
11 {
12 static constexpr _Tp value = __v;
13 };
14
15 template<typename _Tp, _Tp __v>
16 constexpr _Tp integral_constant<_Tp, __v>::value;
17
18 typedef integral_constant<bool, true> true_type;
19 typedef integral_constant<bool, false> false_type;
20
21 template<typename _B1, typename _B2>
22 struct __and_
23 : public conditional<_B1::value, _B2, _B1>::type
24 { };
25
26 template<typename _From, typename _To>
27 struct is_convertible
28 : public true_type
29 { };
30
31 template<bool, typename _Tp = void>
32 struct enable_if
33 { };
34
35 template<typename _Tp>
36 struct enable_if<true, _Tp>
37 { typedef _Tp type; };
38
39 template<bool _Cond, typename _Tp = void>
40 using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
41
42 template<typename A, typename B>
43 using _Require = __enable_if_t<__and_<A, B>::value>;
44
45 template<bool _Cond, typename _Iftrue, typename _Iffalse>
46 struct conditional
47 { typedef _Iftrue type; };
48
49 template<typename> struct iterator_traits;
50
51
52 template<typename _IteratorL, typename _IteratorR>
53 constexpr bool
54 operator!=(const reverse_iterator<_IteratorL>& __x,
55 const reverse_iterator<_IteratorR>& __y);
56
57 typedef __INT64_TYPE__ int64_t;
58 typedef int64_t intmax_t;
59
60 template<intmax_t _Num>
61 struct ratio
62 {
63 };
64
65 namespace chrono
66 {
67 template<typename _Rep>
68 struct duration;
69
70 template<typename _ToDur, typename _Rep>
71 constexpr _ToDur
72 duration_cast(const duration<_Rep>& __d)
73 {
74 typedef typename _ToDur::rep __to_rep;
75 return _ToDur(static_cast<__to_rep>(static_cast<intmax_t>(__d.count())));
76 }
77
78 template<typename _Rep>
79 struct duration
80 {
81
82 public:
83 using rep = _Rep;
84
85 constexpr duration() = default;
86
87 duration(const duration&) = default;
88
89 template<typename _Rep2, typename
90 = _Require<is_convertible<const _Rep2&, rep>,
91 true_type>>
92 constexpr explicit duration(const _Rep2& __rep)
93 : __r (__rep) {}
94
95 ~duration() = default;
96 duration& operator=(const duration&) = default;
97
98 rep count() const;
99
100 private:
101 rep __r;
102 };
103
104 using seconds = duration<int64_t>;
105
106 template<typename _Clock, typename _Dur>
107 struct time_point
108 {
109 typedef _Dur duration;
110
111 duration time_since_epoch() const;
112
113 private:
114 duration __d;
115 };
116
117 struct system_clock
118 {
119 typedef chrono::seconds duration;
120
121 typedef chrono::time_point<system_clock, duration> time_point;
122
123 static void
124 to_time_t(const time_point& __t) noexcept
125 {
126 duration_cast<chrono::seconds>
127 (__t.time_since_epoch()).count();
128 }
129 };
130
131 }
132
133 template<typename>
134 class allocator;
135
136 template<typename _ForwardIterator>
137 constexpr void
138 __destroy(_ForwardIterator __first, _ForwardIterator __last)
139 {
140 for (; __first != __last; ++__first)
141 __addressof (*__first);
142 }
143
144 template<typename _Alloc>
145 struct allocator_traits
146 {
147 private:
148 template<typename _Alloc2, typename _Tp>
149 static constexpr void
150 _S_destroy(_Alloc2&, _Tp* __p, ...)
151 noexcept
152 {
153 __destroy(__p);
154 }
155 };
156
157 template<typename _Tp>
158 struct allocator_traits<allocator<_Tp>>
159 {
160 using value_type = _Tp;
161 using pointer = _Tp*;
162 };
163
164 import "pr99283-6_a.H";