]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/ChangeLog
libstdc++: Add a move-only testsuite iterator type
[thirdparty/gcc.git] / libstdc++-v3 / ChangeLog
CommitLineData
05779e2c
PP
12020-03-04 Patrick Palka <ppalka@redhat.com>
2
d6d4b339
PP
3 * testsuite/util/testsuite_iterators.h (input_iterator_wrapper_nocopy):
4 New testsuite iterator.
5 * testsuite/24_iterators/counted_iterator/lwg3389.cc: use it.
6 * testsuite/24_iterators/move_iterator/lwg3390.cc: Likewise.
7
05779e2c
PP
8 * include/bits/ranges_uninitialized.h
9 (uninitialized_copy_fn::operator()): Pass a reference type as the first
10 argument to is_nothrow_assignable_v.
11 (uninitialized_copy_fn::operator()): Likewise.
12 (uninitialized_move_fn::operator()): Likewise. Return an in_out_result
13 with the input iterator stripped of its move_iterator.
14 (uninitialized_move_n_fn::operator()): Likewise.
15 (uninitialized_fill_fn::operator()): Pass a reference type as the first
16 argument to is_nothrow_assignable_v.
17 (uninitialized_fill_n_fn::operator()): Likewise.
18
9b4f00dd
JW
192020-03-03 Jonathan Wakely <jwakely@redhat.com>
20
462f6c20
JW
21 PR libstdc++/94013
22 * include/bits/cpp_type_traits.h (__memcpyable, __memcmpable): New
23 traits to control when to use memmove and memcmp optimizations.
24 (__is_nonvolatile_trivially_copyable): New helper trait.
25 * include/bits/ranges_algo.h (__lexicographical_compare_fn): Do not
26 use memcmp optimization with volatile data.
27 * include/bits/ranges_algobase.h (__equal_fn): Use __memcmpable.
28 (__copy_or_move, __copy_or_move_backward): Use __memcpyable.
29 * include/bits/stl_algobase.h (__copy_move_a2): Use __memcpyable.
30 (__copy_move_backward_a2): Likewise.
31 (__equal_aux1): Use __memcmpable.
32 (__lexicographical_compare_aux): Do not use memcmp optimization with
33 volatile data.
34 * testsuite/25_algorithms/copy/94013.cc: New test.
35 * testsuite/25_algorithms/copy_backward/94013.cc: New test.
36 * testsuite/25_algorithms/equal/94013.cc: New test.
37 * testsuite/25_algorithms/fill/94013.cc: New test.
38 * testsuite/25_algorithms/lexicographical_compare/94013.cc: New test.
39 * testsuite/25_algorithms/move/94013.cc: New test.
40 * testsuite/25_algorithms/move_backward/94013.cc: New test.
41
9b4f00dd
JW
42 * include/bits/stl_algobase.h (lexicographical_compare_three_way):
43 Avoid redundant iterator comparisons (LWG 3410).
44
5fad0003
JW
452020-03-02 Jonathan Wakely <jwakely@redhat.com>
46
d112e173
JW
47 PR libstdc++/93972
48 * include/bits/stl_algobase.h (__memcmp): Allow pointer types to
49 differ.
50 * testsuite/25_algorithms/lexicographical_compare/uchar.cc: New test.
51
4c391563
JW
52 * include/std/ranges (__detail::__maybe_empty_t): Rename to
53 __maybe_present_t.
54 (__adaptor::_RangeAdaptor, join_view, split_view): Use new name.
55
5fad0003
JW
56 * include/bits/ranges_algo.h (shift_right): Add 'typename' to
57 dependent type.
58
fed76afb
L
592020-03-01 H.J. Lu <hongjiu.lu@intel.com>
60
61 * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
62
bd55ce63
JDA
632020-02-29 John David Anglin <danglin@gcc.gnu.org>
64
566f544c
JDA
65 * testsuite/17_intro/headers/c++1998/charset.cc: Skip on *-*-hpux*.
66 * testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
67 * testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
68 * testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
69 * testsuite/17_intro/headers/c++2020/charset.cc: Likewise.
70
bd55ce63
JDA
71 * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
72 Add libatomic option.
73 * testsuite/30_threads/jthread/jthread.cc: Likewise.
74
44c85722
FD
752020-02-29 François Dumont <fdumont@gcc.gnu.org>
76
77 * include/bits/stl_algo.h
78 (__find_if, __count_if, __is_permutation, std::is_permutation): Move...
79 * include/bits/stl_algobase.h: ...here.
80 * include/bits/hashtable_policy.h: Remove <bits/stl_algo.h> include.
81
d4912dc7
JDA
822020-02-29 John David Anglin <danglin@gcc.gnu.org>
83
68a1a11f
JDA
84 * testsuite/30_threads/stop_token/stop_callback.cc: Add libatomic
85 option.
86 * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc:
87 Likewise.
88 * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: Likewise.
89 * testsuite/30_threads/stop_token/stop_callback/destroy.cc: Likewise.
90 * testsuite/30_threads/stop_token/stop_callback/invoke.cc: Likewise.
91 * testsuite/30_threads/stop_token/stop_source.cc: Likewise.
92 * testsuite/30_threads/stop_token/stop_source/assign.cc: Likewise.
93 * testsuite/30_threads/stop_token/stop_token.cc: Likewise.
94 * testsuite/30_threads/stop_token/stop_token/stop_possible.cc:
95 Likewise.
96
d4912dc7
JDA
97 PR libstdc++/92906
98 * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
99
799270b4
PP
1002020-02-28 Patrick Palka <ppalka@redhat.com>
101
ce33801f
PP
102 PR libstdc++/93972
103 * include/bits/ranges_algo.h (__lexicographical_compare_fn::operator()):
104 Fix condition for when to use memcmp, making it consistent with the
105 corresponding condition used in std::lexicographical_compare.
106 * testsuite/25_algorithms/lexicographical_compare/93972.cc: New test.
107
799270b4
PP
108 * testsuite/26_numerics/headers/numeric/synopsis.cc: Add signatures for
109 functions introduced in C++11, C++17 and C++2a. Add 'constexpr' to
110 existing signatures for C++2a.
111
4735f92d
JW
1122020-02-28 Jonathan Wakely <jwakely@redhat.com>
113
114 * testsuite/24_iterators/range_operations/advance_debug_neg.cc: Run
115 test instead of just compiling it.
116
a1535015
PP
1172020-02-28 Patrick Palka <ppalka@redhat.com>
118
77e596cf
PP
119 * include/std/ranges (reverse_view::_S_needs_cached_begin): Set to false
120 whenever the underlying range models common_range.
121
a1535015
PP
122 * include/std/ranges (__detail::_CachedPosition): New struct.
123 (views::filter_view::_S_needs_cached_begin): New member variable.
124 (views::filter_view::_M_cached_begin): New member variable.
125 (views::filter_view::begin): Use _M_cached_begin to cache its
126 result.
127 (views::drop_view::_S_needs_cached_begin): New static member variable.
128 (views::drop_view::_M_cached_begin): New member variable.
129 (views::drop_view::begin): Use _M_cached_begin to cache its result
130 when _S_needs_cached_begin.
131 (views::drop_while_view::_M_cached_begin): New member variable.
132 (views::drop_while_view::begin): Use _M_cached_begin to cache its
133 result.
134 (views::reverse_view::_S_needs_cached_begin): New static member
135 variable.
136 (views::reverse_view::_M_cached_begin): New member variable.
137 (views::reverse_view::begin): Use _M_cached_begin to cache its result
138 when _S_needs_cached_begin.
139 * testsuite/std/ranges/adaptors/drop.cc: Augment test to check that
140 drop_view::begin caches its result.
141 * testsuite/std/ranges/adaptors/drop_while.cc: Augment test to check
142 that drop_while_view::begin caches its result.
143 * testsuite/std/ranges/adaptors/filter.cc: Augment test to check that
144 filter_view::begin caches its result.
145 * testsuite/std/ranges/adaptors/reverse.cc: Augment test to check that
146 reverse_view::begin caches its result.
147
86e2dc22
JW
1482020-02-28 Jonathan Wakely <jwakely@redhat.com>
149
a51a546c
JW
150 * testsuite/27_io/filesystem/operations/last_write_time.cc: Fixes for
151 filesystems that silently truncate timestamps.
152 * testsuite/experimental/filesystem/operations/last_write_time.cc:
153 Likewise.
154
86e2dc22
JW
155 * testsuite/21_strings/basic_string/cons/char/1.cc: Disable
156 -Wstringop-overflow warnings.
157
44949494
JW
1582020-02-27 Jonathan Wakely <jwakely@redhat.com>
159
160 * testsuite/lib/libstdc++.exp (v3_target_compile): Add
161 -fdiagnostics-urls=never to options.
162
10a32d47
PP
1632020-02-27 Patrick Palka <ppalka@redhat.com>
164
ba49e9eb
PP
165 * include/std/ranges (transform_view::_Iterator<_Const>): Befriend
166 _Iterator<!_Const>.
167 (transform_view::_Sentinel<_Const>): Befriend _Sentinel<!_Const>.
168 (take_view::_Sentinel<_Const>): Likewise.
169 (take_while_view::_Sentinel<_Const>): Likewise.
170 (split_view::_OuterIter<_Const>): Befriend _OuterIter<!_Const>.
171 * testsuite/std/ranges/adaptors/split.cc: Augment test.
172 * testsuite/std/ranges/adaptors/take.cc: Augment test.
173 * testsuite/std/ranges/adaptors/take_while.cc: Augment test.
174 * testsuite/std/ranges/adaptors/transform.cc: Augment test.
175
10a32d47
PP
176 * testsuite/25_algorithms/copy/constrained.cc: Don't assume that the
177 base() of a vector<>::iterator is a pointer.
178 * testsuite/25_algorithms/copy_backward/constrained.cc: Likewise.
179 * testsuite/25_algorithms/move/constrained.cc: Likewise.
180 * testsuite/25_algorithms/move_backward/constrained.cc: Likewise.
181 * testsuite/25_algorithms/inplace_merge/constrained.cc: Use foo.data()
182 instead of &foo[0].
183 * testsuite/25_algorithms/partial_sort/constrained.cc: Likewise.
184 * testsuite/25_algorithms/partial_sort_copy/constrained.cc: Likewise.
185 * testsuite/25_algorithms/shuffle/constrained.cc: Likewise.
186 * testsuite/25_algorithms/sort/constrained.cc: Likewise.
187 * testsuite/25_algorithms/stable_sort/constrained.cc: Likewise.
188
eb8e6a30
JW
1892020-02-27 Jonathan Wakely <jwakely@redhat.com>
190
ae705159
JW
191 * include/debug/array (operator<=>): Define for C++20.
192 * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
193 Adjust dg-error line numbers.
194 * testsuite/23_containers/array/tuple_interface/
195 tuple_element_debug_neg.cc: Likewise.
196
b112e3cb
JW
197 * testsuite/23_containers/span/back_assert_neg.cc: Add #undef before
198 defining _GLIBCXX_ASSERTIONS.
199 * testsuite/23_containers/span/first_2_assert_neg.cc: Likewise.
200 * testsuite/23_containers/span/first_assert_neg.cc: Likewise.
201 * testsuite/23_containers/span/front_assert_neg.cc: Likewise.
202 * testsuite/23_containers/span/index_op_assert_neg.cc: Likewise.
203 * testsuite/23_containers/span/last_2_assert_neg.cc: Likewise.
204 * testsuite/23_containers/span/last_assert_neg.cc: Likewise.
205 * testsuite/23_containers/span/subspan_2_assert_neg.cc: Likewise.
206 * testsuite/23_containers/span/subspan_3_assert_neg.cc: Likewise.
207 * testsuite/23_containers/span/subspan_4_assert_neg.cc: Likewise.
208 * testsuite/23_containers/span/subspan_5_assert_neg.cc: Likewise.
209 * testsuite/23_containers/span/subspan_6_assert_neg.cc: Likewise.
210 * testsuite/23_containers/span/subspan_assert_neg.cc: Likewise.
211
f32a3662
JW
212 * include/debug/string (__gnu_debug::basic_string::insert): Fix for
213 C++98 where the member function of the base class returns void.
214
e94f2542
JW
215 * testsuite/util/testsuite_iterators.h (forward_iterator_wrapper): Add
216 equality comparisons that support value-initialized iterators.
217
eb8e6a30
JW
218 * include/bits/boost_concept_check.h (__function_requires): Add
219 _GLIBCXX14_CONSTEXPR.
220 * testsuite/25_algorithms/min/concept_checks.cc: New test.
221
fd335985
PP
2222020-02-26 Patrick Palka <ppalka@redhat.com>
223
8ce13842
PP
224 PR libstdc++/93936
225 * include/std/ranges (split_view::_InnerIter::operator==): Compare
226 the operands' _M_i rather than their _M_i.current().
227 * testsuite/std/ranges/adaptors/split.cc: Augment test.
228
fd335985
PP
229 P1645R1 constexpr for <numeric> algorithms
230 * include/bits/stl_numeric.h (iota, accumulate, inner_product,
231 partial_sum, adjacent_difference): Make conditionally constexpr for
232 C++20.
233 * include/std/numeric (__cpp_lib_constexpr_numeric): Define this feature
234 test macro.
235 (reduce, transform_reduce, exclusive_scan, inclusive_scan,
236 transform_exclusive_scan, transform_inclusive_scan): Make conditionally
237 constexpr for C++20.
238 * include/std/version (__cpp_lib_constexpr_numeric): Define.
239 * testsuite/26_numerics/accumulate/constexpr.cc: New test.
240 * testsuite/26_numerics/adjacent_difference/constexpr.cc: Likewise.
241 * testsuite/26_numerics/exclusive_scan/constexpr.cc: Likewise.
242 * testsuite/26_numerics/inclusive_scan/constexpr.cc: Likewise.
243 * testsuite/26_numerics/inner_product/constexpr.cc: Likewise.
244 * testsuite/26_numerics/iota/constexpr.cc: Likewise.
245 * testsuite/26_numerics/partial_sum/constexpr.cc: Likewise.
246 * testsuite/26_numerics/reduce/constexpr.cc: Likewise.
247 * testsuite/26_numerics/transform_exclusive_scan/constexpr.cc: Likewise.
248 * testsuite/26_numerics/transform_inclusive_scan/constexpr.cc: Likewise.
249 * testsuite/26_numerics/transform_reduce/constexpr.cc: Likewise.
250
8017d95c
JW
2512020-02-26 Jonathan Wakely <jwakely@redhat.com>
252
113f0a63
JW
253 * include/bits/ranges_algo.h (__lexicographical_compare_fn): Declare
254 variables in smaller scope and avoid calling ranges::distance when we
255 know they are pointers. Remove statically-unreachable use of
256 __builtin_unreachable().
257 * include/bits/stl_algobase.h (__lexicographical_compare::__lc):
258 Define inline.
259
8017d95c
JW
260 * include/std/ranges (__detail::__maybe_empty_t): Define new helper
261 alias.
262 (__detail::__maybe_const_t): Likewise.
263 (__adaptor::_RangeAdaptor): Use __maybe_empty_t.
264 (transform_view, take_view, take_while_view, elements_view): Use
265 __maybe_const_t.
266 (join_view, split_view): Use both.
267
7f0f1083
PP
2682020-02-25 Patrick Palka <ppalka@redhat.com>
269
76a8c0f6
PP
270 LWG 3397 basic_istream_view::iterator should not provide
271 iterator_category
272 * include/std/ranges (basic_istream_view:_Iterator::iterator_category):
273 Rename to ...
274 (basic_istream_view:_Iterator::iterator_concept): ... this.
275 * testsuite/std/ranges/istream_view.cc: Augment test.
276
ec15da7c
PP
277 LWG 3325 Constrain return type of transformation function for
278 transform_view
279 * include/std/ranges (transform_view): Constrain the return type of the
280 transformation function as per LWG 3325.
281 * testsuite/std/ranges/adaptors/lwg3325_neg.cc: New test.
282
55c4b3f4
PP
283 LWG 3313 join_view::_Iterator::operator-- is incorrectly constrained
284 * include/std/ranges (join_view::_Iterator::operator--): Require that
285 range_reference_t<_Base> models common_range.
286 * testsuite/std/ranges/adaptors/lwg3313_neg.cc: New test.
287
510bd1c1
PP
288 LWG 3301 transform_view::_Iterator has incorrect iterator_category
289 * include/std/ranges (transform_view::_Iterator::_S_iter_cat): Adjust
290 determination of iterator_category as per LWG 3301.
291 * testsuite/std/ranges/adaptors/transform.cc: Augment test.
292
7f0f1083
PP
293 LWG 3292 iota_view is under-constrained
294 * include/std/ranges (iota_view): Require that _Winc models semiregular
295 as per LWG 3292.
296 * testsuite/std/ranges/iota/lwg3292_neg.cc: New test.
297
dfb93d05 2982020-02-25 Jonathan Wakely <jwakely@redhat.com>
5b904f17 299
490350a1
JW
300 * include/bits/ranges_algobase.h (__copy_or_move): Do not use memmove
301 during constant evaluation. Call __builtin_memmove directly instead of
302 __memmove.
303 (__copy_or_move_backward): Likewise.
304 * include/bits/stl_algobase.h (__memmove): Remove.
305 (__copy_move<M, true, random_access_iterator_tag>::__copy_m)
306 (__copy_move_backward<M, true, random_access_iterator_tag>::__copy_m):
307 Use __builtin_memmove directly instead of __memmove.
308 (__copy_move_a2): Do not use memmove during constant evaluation.
309 (__copy_move_backward_a2): Use _IsMove constant to select correct
310 __copy_move_backward specialization.
311 * testsuite/25_algorithms/copy_backward/constexpr.cc: Check for copies
312 begin turned into moves during constant evaluation.
313
6de946e6
JW
314 * testsuite/25_algorithms/move_backward/93872.cc: Add test left out of
315 previous commit.
316
5b904f17
JW
317 PR libstdc++/93872
318 * include/bits/stl_algobase.h (__memmove): Cast away const before
319 doing move assignment.
320 * testsuite/25_algorithms/move/93872.cc: New test.
321 * testsuite/25_algorithms/move_backward/93872.cc: New test.
322
c5eab4ed
PP
3232020-02-24 Patrick Palka <ppalka@redhat.com>
324
85c143d0
PP
325 PR libstdc++/93884
326 * include/bits/ranges_algobase.h (__copy_or_move,
327 __copy_or_move_backward): Don't inspect the iter_value_t of the output
328 iterator, instead inspect its iterator_traits directly.
329 * include/bits/stl_iterator.h (back_insert_iterator::container):
330 Conditionally initialize.
331 (back_insert_iterator::difference_type): Conditionally define.
332 (back_insert_iterator::back_insert_iterator): Conditionally define this
333 default constructor.
334 (front_insert_iterator::container): Conditionally initialize.
335 (front_insert_iterator::difference_type): Conditionally define.
336 (front_insert_iterator::front_insert_iterator): Conditionally define
337 this default constructor.
338 * 24_iterators/back_insert_iterator/pr93884.cc: New test.
339 * 24_iterators/front_insert_iterator/pr93884.cc: New test.
340
c5eab4ed
PP
341 P0769R2 Add shift to <algorithm>
342 * include/bits/ranges_algo.h (shift_left, shift_right): New.
343 * testsuite/25_algorithms/shift_left/1.cc: New test.
344 * testsuite/25_algorithms/shift_right/1.cc: New test.
345
3841739c
JW
3462020-02-24 Jonathan Wakely <jwakely@redhat.com>
347
8566286e
JW
348 * include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)):
349 Make noexcept-specifier conditional.
350 * testsuite/24_iterators/istream_iterator/cons/sentinel.cc: Check
351 noexcept-specifier.
352
120e8734
JW
353 * include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)):
354 Add constructor.
355 (operator==(istream_iterator, default_sentinel_t)): Add operator.
356 (ostream_iterator::difference_type): Define to ptrdiff_t for C++20.
357 * include/bits/streambuf_iterator.h
358 (istreambuf_iterator(default_sentinel_t)): Add constructor.
359 (operator==(istreambuf_iterator, default_sentinel_t)): Add operator.
360 * testsuite/24_iterators/istream_iterator/cons/sentinel.cc:
361 New test.
362 * testsuite/24_iterators/istream_iterator/sentinel.cc: New test.
363 * testsuite/24_iterators/istreambuf_iterator/cons/sentinel.cc:
364 New test.
365 * testsuite/24_iterators/istreambuf_iterator/sentinel.cc: New test.
366
3841739c
JW
367 * include/std/ranges (__deep_const_range, __enable_view_impl): Remove.
368 (ranges::enable_view): Simplify (LWG 3326).
369 * include/bits/range_access.h (ranges::enable_view): Declare.
370 * include/bits/regex.h (__enable_view_impl): Remove partial
371 specialization.
372 * include/bits/stl_multiset.h (__enable_view_impl): Likewise.
373 * include/bits/stl_set.h (__enable_view_impl): Likewise.
374 * include/bits/unordered_set.h (__enable_view_impl): Likewise.
375 * include/debug/multiset.h (__enable_view_impl): Likewise.
376 * include/debug/set.h (__enable_view_impl): Likewise.
377 * include/debug/unordered_set (__enable_view_impl): Likewise.
378 * include/experimental/string_view (ranges::enable_view): Define
379 partial specialization.
380 * include/std/span (ranges::enable_view): Likewise.
381 * include/std/string_view (ranges::enable_view): Likewise.
382 * testsuite/std/ranges/view.cc: Check satisfaction of updated concept.
383
9e589880
JW
3842020-02-21 Jonathan Wakely <jwakely@redhat.com>
385
386 * include/std/optional (operator<=>(optional<T>, optional<U>))
387 (operator<=>(optional<T>, nullopt), operator<=>(optional<T>, U)):
388 Define for C++20.
389 * include/std/tuple (__tuple_cmp): New helper function for <=>.
390 (operator<=>(tuple<T...>, tuple<U>...)): Define for C++20.
391 * include/std/variant (operator<=>(variant<T...>, variant<T...>))
392 (operator<=>(monostate, monostate)): Define for C++20.
393 * testsuite/20_util/optional/relops/three_way.cc: New test.
394 * testsuite/20_util/tuple/comparison_operators/three_way.cc: New test.
395 * testsuite/20_util/variant/89851.cc: Move to ...
396 * testsuite/20_util/variant/relops/89851.cc: ... here.
397 * testsuite/20_util/variant/90008.cc: Move to ...
398 * testsuite/20_util/variant/relops/90008.cc: ... here.
399 * testsuite/20_util/variant/relops/three_way.cc: New test.
400
5586e506
PP
4012020-02-20 Patrick Palka <ppalka@redhat.com>
402
6e63438a
PP
403 * include/std/ranges (views::__adaptor::__maybe_refwrap): New utility
404 function.
405 (views::__adaptor::_RangeAdaptor::operator()): Add comments. Use
406 __maybe_refwrap to capture lvalue references by reference, and then use
407 unwrap_reference_t to forward the by-reference captures as references.
408 * testsuite/std/ranges/adaptors/split.cc: Augment test.
409 * testsuite/std/ranges/adaptors/split_neg.cc: New test.
410
5586e506
PP
411 * include/std/ranges (iota_view): Forward declare _Sentinel.
412 (iota_view::_Iterator): Befriend _Sentinel.
413 (iota_view::_Sentinel::_M_equal): New member function.
414 (iota_view::_Sentinel::operator==): Use it.
415 (views::_Iota::operator()): Forward __f using the correct type.
416 * testsuite/std/ranges/access/ssize.cc (test06): Don't call views::iota
417 with integers of different signedness, to appease iota_view's deduction
418 guide.
419 * testsuite/std/ranges/iota/iota_view.cc: Augment test.
420
c7b591f3
JW
4212020-02-20 Jonathan Wakely <jwakely@redhat.com>
422
e817c23f
JW
423 * include/bits/range_access.h (ranges::begin): Reject array of
424 incomplete type.
425 (ranges::end, ranges::size): Require arrays to be bounded.
426 (ranges::data): Require lvalue or borrowed_range.
427 (ranges::iterator_t): Remove constraint.
428 * testsuite/std/ranges/access/begin.cc: Do not check array of
429 incomplete type.
430 * testsuite/std/ranges/access/begin_neg.cc: New test.
431 * testsuite/std/ranges/access/end_neg.cc: Adjust expected error.
432 * testsuite/std/ranges/access/size_neg.cc: Adjust expected error.
433 * testsuite/std/ranges/access/ssize.cc: Do not check array of
434 incomplete type.
435
4be779f5
JW
436 * include/std/system_error (error_category::operator<=>)
437 (operator<=>(const error_code&, const error_code&))
438 (operator<=>(const error_condition&, const error_condition&)): Define
439 for C++20.
440 * testsuite/19_diagnostics/error_category/operators/less.cc: New test.
441 * testsuite/19_diagnostics/error_category/operators/three_way.cc: New
442 test.
443 * testsuite/19_diagnostics/error_code/operators/equal.cc: Remove
444 incorrect comment.
445 * testsuite/19_diagnostics/error_code/operators/less.cc: New test.
446 * testsuite/19_diagnostics/error_code/operators/not_equal.cc: Remove
447 incorrect comment.
448 * testsuite/19_diagnostics/error_code/operators/three_way.cc: New test.
449 * testsuite/19_diagnostics/error_condition/operators/equal.cc: Remove
450 incorrect comment.
451 * testsuite/19_diagnostics/error_condition/operators/less.cc: New test.
452 * testsuite/19_diagnostics/error_condition/operators/not_equal.cc:
453 Remove incorrect comment.
454 * testsuite/19_diagnostics/error_condition/operators/three_way.cc: New
455 test.
456
20fa41e6
JW
457 * libsupc++/typeinfo (type_info::operator!=): Remove for C++20.
458
c7b591f3
JW
459 * include/std/thread (thread::id::operator<=>): Define for C++20.
460 * testsuite/30_threads/thread/id/70294.cc: Do not take addresses of
461 functions in namespace std.
462 * testsuite/30_threads/thread/id/operators_c++20.cc: New test.
463
38c7b74d
PP
4642020-02-19 Patrick Palka <ppalka@redhat.com>
465
466 * testsuite/std/ranges/adaptors/split.cc (test03): Don't include the
467 null terminator of the underlying string as part of the test_range.
468 (main): Call test03.
469
a45fb21a
JW
4702020-02-19 Jonathan Wakely <jwakely@redhat.com>
471
1b425f3a
JW
472 * include/bits/stl_iterator.h (common_iterator): Add copyable<I>
473 requirement (LWG 3385).
474 * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust
475 expected declaration.
476
7433536b
JW
477 * include/std/ranges (take_while_view, drop_view, drop_while_view)
478 (elements_view:_Iterator): Initialize data members (LWG 3364).
479
256f67aa
JW
480 * libsupc++/compare (three_way_comparable): Remove always-false check
481 that should have been removed with weak_equality (P1959R0).
482 (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360).
483
0294dc5f
JW
484 * include/std/concepts (__detail::__partially_ordered_with): Move here
485 from <compare>.
486 (totally_ordered, totally_ordered_with): Use __partially_ordered_with
487 to simplify definition (LWG 3331).
488 * libsupc++/compare (__detail::__partially_ordered_with): Move to
489 <concepts>.
490
241ed965
JW
491 * include/std/concepts (totally_ordered_with): Remove redundant
492 requirement (LWG 3329).
493
77f5310f
JW
494 * include/std/ranges (__detail::__convertible_to_non_slicing): New
495 helper concept.
496 (__detail::__pair_like_convertible_to): Remove.
497 (__detail::__pair_like_convertible_from): Add requirements for
498 non-slicing conversions.
499 (subrange): Constrain constructors with __convertible_to_non_slicing.
500 Remove constructors from pair-like types. Add new deduction guide.
501 * testsuite/std/ranges/subrange/lwg3282_neg.cc: New test.
502
59aa9e57
JW
503 * include/bits/iterator_concepts.h (iter_move): Add declaration to
504 prevent unqualified lookup finding a suitable declaration (LWG 3247).
505
e89100ef
JW
506 * include/std/memory_resource (polymorphic_allocator::allocate)
507 (polymorphic_allocator::allocate_object): Change type of exception to
508 bad_array_new_length (LWG 3237).
509 * testsuite/20_util/polymorphic_allocator/lwg3237.cc: New test.
510
bb54e0b8
JW
511 * include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348).
512 * include/std/version (__cpp_lib_unwrap_ref): Likewise.
513 * testsuite/20_util/unwrap_reference/1.cc: Check macro.
514 * testsuite/20_util/unwrap_reference/3.cc: New test.
515
5f031f97
JW
516 * include/std/numeric (midpoint(T8, T*)): Do not check for complete
517 type during overload resolution, use static assert instead (LWG 3200).
518 * testsuite/26_numerics/midpoint/pointer.cc: Do not test with
519 incomplete type.
520 * testsuite/26_numerics/midpoint/pointer_neg.cc: New test.
521
66ae31eb
JW
522 * include/std/span (span(T (&)[N])): Use non-deduced context to
523 prevent first parameter from interfering with class template argument
524 deduction (LWG 3369).
525 * testsuite/23_containers/span/deduction.cc: Add missing 'const'.
526 * testsuite/23_containers/span/lwg3255.cc: Check for construction from
527 rvalues.
528
247f410b
JW
529 * include/std/span (span::const_iterator, span::const_reverse_iterator)
530 (span::cbegin(), span::cend(), span::crbegin(), span::crend()):
531 Remove (LWG 3320).
532 * testsuite/23_containers/span/everything.cc: Replace uses of cbegin
533 and cend.
534 * testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
535 Likewise.
536 * testsuite/20_util/specialized_algorithms/uninitialized_copy/
537 constrained.cc: Likewise.
538 * testsuite/20_util/specialized_algorithms/
539 uninitialized_default_construct/constrained.cc: Likewise.
540 * testsuite/20_util/specialized_algorithms/uninitialized_fill/
541 constrained.cc: Likewise.
542 * testsuite/20_util/specialized_algorithms/uninitialized_move/
543 constrained.cc: Likewise.
544 * testsuite/20_util/specialized_algorithms/
545 uninitialized_value_construct/constrained.cc: Likewise.
546
aca60ecf
JW
547 * include/bits/range_access.h (range_size_t): Define alias template.
548 * include/std/ranges (all_view): Rename to views::all_t (LWG 3335).
549 * testsuite/std/ranges/adaptors/filter.cc: Adjust to new name.
550
4cc3b275
JW
551 * include/std/ranges (filter_view, transform_view, take_view)
552 (join_view, split_view, reverse_view): Remove commented-out converting
553 constructors (LWG 3280).
554
5f3641d0
JW
555 * include/std/memory (uninitialized_construct_using_allocator): Use
556 std::construct_at (LWG 3321).
557
020a03ee
JW
558 * include/std/memory_resource (polymorphic_allocator::allocate_bytes)
559 (polymorphic_allocator::allocate_object)
560 (polymorphic_allocator::new_object): Add nodiscard attribute (LWG3304).
561
15411a64
JW
562 LWG 3379. "safe" in several library names is misleading
563 * include/bits/range_access.h (enable_safe_range): Rename to
564 enable_borrowed_range.
565 (__detail::__maybe_safe_range): Rename to __maybe_borrowed_range.
566 (safe_range): Rename to borrowed_range.
567 * include/bits/ranges_algo.h: Adjust to use new names.
568 * include/bits/ranges_algobase.h: Likewise.
569 * include/bits/ranges_uninitialized.h: Likewise.
570 * include/std/ranges: Likewise.
571 (safe_iterator_t): Rename to borrowed_iterator_t.
572 (safe_subrange_t): Rename to borrowed_subrange_t.
573 * include/std/span: Adjust to use new names.
574 * include/std/string_view: Likewise.
575 * include/experimental/string_view: Likewise.
576 * testsuite/std/ranges/access/begin.cc: Likewise.
577 * testsuite/std/ranges/access/cbegin.cc: Likewise.
578 * testsuite/std/ranges/access/cdata.cc: Likewise.
579 * testsuite/std/ranges/access/cend.cc: Likewise.
580 * testsuite/std/ranges/access/crbegin.cc: Likewise.
581 * testsuite/std/ranges/access/crend.cc: Likewise.
582 * testsuite/std/ranges/access/data.cc: Likewise.
583 * testsuite/std/ranges/access/end.cc: Likewise.
584 * testsuite/std/ranges/access/rbegin.cc: Likewise.
585 * testsuite/std/ranges/access/rend.cc: Likewise.
586 * testsuite/std/ranges/safe_range.cc: Likewise.
587 * testsuite/std/ranges/safe_range_types.cc: Likewise.
588 * testsuite/util/testsuite_iterators.h: Likewise.
589
fa89adaa
JW
590 * include/std/ranges (tuple_element<0, const subrange<I, S, K>>)
591 (tuple_element<1, const subrange<I, S, K>>): Add partial
592 specializations (LWG 3398).
593 * testsuite/std/ranges/subrange/tuple_like.cc: New test.
594
a45fb21a
JW
595 * include/bits/ranges_algo.h (__find_fn, __find_first_of_fn)
596 (__adjacent_find_fn, __remove_if_fn, __remove_copy_if_fn)
597 (__unique_fn, __unique_copy_fn): Remove redundant conversions to bool.
598
242b4fb7
PP
5992020-02-18 Patrick Palka <ppalka@redhat.com>
600
601 P1983R0 Wording for GB301, US296, US292, US291, and US283
602 * include/std/ranges (filter_view::pred): New member function.
603 (join_view::_Iterator::_Iterator): Remove now-redundant comment since
604 P1983R0 fixes the highlighted issue in the same way.
605 (join_view::_Iterator<_Const>): Add friend
606 join_view::_Iterator<!_Const>.
607 (join_view::_M_inner): Remove mutable specifier, effectively reverting
608 the proposed wording changes of P3278.
609 (join_view::begin): Refine the condition for when to return a const
610 iterator.
611 (split_view::_OuterIter::_OuterIter): Adjust constraints.
612 * testsuite/std/ranges/adaptors/filter.cc: Test that filter_view::pred
613 exists and works.
614
f5b4dc38
JW
6152020-02-18 Jonathan Wakely <jwakely@redhat.com>
616
a5b213dd
JW
617 PR libstdc++/93818
618 * include/std/ranges (_RangeAdaptor): Add deduction guide.
619 (filter_view::_Iterator): Add alias _Vp_iter and use in place of
620 iterator_t<_Vp>.
621 (filter_view::_Iterator::_S_iter_cat()): Add 'typename'.
622 (transform_view::_Iterator): Add alias _Base_iter and use in place of
623 iterator_t<_Base>.
624 (transform_view::_Iterator::_S_iter_cat()): Add 'typename'.
625 (join_view::_Iterator): Add _Outer_iter and _Inner_iter aliases.
626 (join_view::_Iterator::_S_iter_cat()): Add 'typename'.
627 (split_view::_InnerIter::_S_iter_cat()): Likewise.
628
ce7b39d0
JW
629 * testsuite/20_util/integer_comparisons/equal.cc: Fix invalid
630 assumption that long is wider than int.
631 * testsuite/20_util/integer_comparisons/greater_equal.cc: Likewise.
632 * testsuite/20_util/integer_comparisons/less.cc: Likewise.
633 * testsuite/20_util/integer_comparisons/less_equal.cc: Likewise.
634 * testsuite/20_util/integer_comparisons/not_equal.cc: Likewise.
635
9b8e2dea
JW
636 P1976R2 Fixed-size span construction from dynamic range
637 * include/std/span (__cpp_lib_span): Update value.
638 (span(It, size_type), span(It, End)): Make conditionally explicit. Add
639 assertion.
640 (span(R&&), span(const span<OType, OExtent>&)): Likewise and relax
641 constraints.
642 (span::first<Count>(), span::last<Count>()): Use explicit type in
643 return statement.
644 (as_bytes, as_writable_bytes): Likewise.
645 * include/std/version (__cpp_lib_span): Update value.
646 * testsuite/23_containers/span/1.cc: Check new value.
647 * testsuite/23_containers/span/2.cc: Check new value.
648 * testsuite/23_containers/span/explicit.cc: New test.
649
d6c9e372
JW
650 * include/std/span (span::__is_compatible_array): Simplify alias
651 template by using requires-clause.
652 (span::__is_compatible_ref): New alias template for constraining
653 constructors.
654 (span::__is_compatible_iterator, span::__is_compatible_range): Remove.
655 (span(It, size_type), span(It, End)): Use __is_compatible_ref.
656 (span(T(&)[N], span(array<T, N>&), span(const array<T, N>&)): Remove
657 redundant parentheses.
658 (span(R&&)): Add missing constraints.
659
f09f3242
JW
660 * include/std/span (span): Reorder members and rename template
661 parameters to match declarations in the C++2a working paper.
662
f5b4dc38
JW
663 P2116R0 Remove tuple-like protocol support from fixed-extent span
664 * include/std/span (get, tuple_size, tuple_element): Remove.
665 * testsuite/23_containers/span/everything.cc: Remove checks for
666 tuple-like API.
667 * testsuite/23_containers/span/get_neg.cc: Remove.
668 * testsuite/23_containers/span/tuple_element_dynamic_neg.cc: Remove.
669 * testsuite/23_containers/span/tuple_element_oob_neg.cc: Remove.
670 * testsuite/23_containers/span/tuple_size_neg.cc: Remove.
671
f3169941
PP
6722020-02-17 Patrick Palka <ppalka@redhat.com>
673
aa667c3f
PP
674 P2106R0 Alternative wording for GB315 and GB316
675 * include/bits/ranges_algo.h (in_fun_result): New.
676 (for_each_result, for_each_n_result): Change into an alias of
677 in_fun_result.
678 (in_in_result): New.
679 (mismatch_result): Change into an alias of in_in_result.
680 (copy_if_result): Change into an alias of in_out_result.
681 (swap_ranges_result): Change into an alias of in_in_result.
682 (unary_transform_result): Change into an alias of in_out_result.
683 (in_in_out_result): New.
684 (binary_transform_result): Change into an alias of in_in_out_result.
685 (replace_copy_result, replace_copy_if_result, remove_copy_if_result,
686 remove_copy_result, unique_copy_result, reverse_copy_result,
687 rotate_copy_result, partial_sort_copy_result): Change into an alias of
688 in_out_result.
689 (in_out_out_result): New.
690 (partition_copy_result, merge_result): Change into an alias of
691 in_out_out_result.
692 (set_union_result, set_intersection_result): Change into an alias of
693 in_in_out_result.
694 (set_difference_result): Change into an alias of in_out_result.
695 (set_symmetric_difference): Change into an alias of in_in_out_result.
696 (min_max_result): New.
697 (minmax_result, minmax_element_result): Change into an alias of
698 min_max_result.
699 (in_found_result): New.
700 (next_permutation_result, prev_permutation_result): Change into an alias
701 of in_found_result.
702 (__next_permutation_fn::operator(), __prev_permutation_fn::operator()):
703 Adjust following changes to next_permutation_result and
704 prev_permutation_result.
705 * include/bits/ranges_algobase.h (in_out_result): New.
706 (copy_result, move_result, move_backward_result, copy_backward_result,
707 copy_n_result): Change into an alias of in_out_result.
708 * include/bits/ranges_uninitialized.h (uninitialized_copy_result,
709 uninitialized_copy_n_result, uninitialized_move_result,
710 uninitialized_move_n_result): Likewise.
711 * testsuite/25_algorithms/next_permutation/constrained.cc: Adjust uses of
712 structured bindings.
713 * testsuite/25_algorithms/prev_permutation/constrained.cc: Likewise.
714
f3169941
PP
715 P1243R4 Rangify new algorithms
716 * include/bits/ranges_algo.h (for_each_n_result, __for_each_n_fn,
717 for_each_n, __sample_fn, sample, __clamp_fn, clamp): New.
718 * testsuite/25_algorithms/clamp/constrained.cc: New test.
719 * testsuite/25_algorithms/for_each/constrained.cc: Augment test.
720 * testsuite/25_algorithms/sample/constrained.cc: New test.
721
98cf2c26
JW
7222020-02-17 Jonathan Wakely <jwakely@redhat.com>
723
c5e1c1d3
JW
724 P1964R2 Wording for boolean-testable
725 * include/bits/ranges_algo.h (__find_fn, __find_first_of_fn)
726 (__adjacent_find_fn): Cast result of predicate to bool.
727 * include/std/concepts (__boolean): Remove.
728 (__detail::__boolean_testable_impl, __detail::__boolean_testable): Add
729 new helper concepts.
730 (__detail::__weakly_eq_cmp_with, totally_ordered, totally_ordered_with)
731 (predicate): Use __boolean_testable instead of boolean.
732 * libsupc++/compare (__detail::__partially_ordered, _Synth3way):
733 Likewise.
734
7ab36231
JW
735 P1970R2 Consistency for size() functions: Add ranges::ssize
736 * include/bits/range_access.h (_SSize, ssize): Define for C++20.
737 * testsuite/std/ranges/access/ssize.cc: New test.
738
9866abe3
JW
739 P1956R1 On the names of low-level bit manipulation functions
740 * include/bits/hashtable_policy.h: Update comment.
741 * include/std/bit (__ispow2, __ceil2, __floor2, __log2p1): Rename.
742 (ispow2, ceil2, floor2, log2p1): Likewise.
743 (__cpp_lib_int_pow2): Add feature test macro.
744 * include/std/charconv (__to_chars_len_2): Adjust use of __log2p1.
745 * include/std/memory (assume_aligned): Adjust use of ispow2.
746 * include/std/version (__cpp_lib_int_pow2): Add.
747 * libsupc++/new_opa.cc: Adjust use of __ispow2.
748 * src/c++17/memory_resource.cc: Likewise, and for __ceil2 and __log2p1.
749 * testsuite/17_intro/freestanding.cc: Adjust use of ispow2.
750 * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Rename to ...
751 * testsuite/26_numerics/bit/bit.pow.two/bit_ceil.cc: ... here.
752 * testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: Rename to ...
753 * testsuite/26_numerics/bit/bit.pow.two/bit_ceil_neg.cc: ... here.
754 * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Rename to ...
755 * testsuite/26_numerics/bit/bit.pow.two/bit_floor.cc: ... here.
756 * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Rename to ...
757 * testsuite/26_numerics/bit/bit.pow.two/bit_width.cc: ... here.
758 * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Rename to ...
759 * testsuite/26_numerics/bit/bit.pow.two/has_single_bit.cc: ... here.
760
cfbc8fbb
JW
761 * include/std/charconv: Add comment.
762
9cd4eeef
JW
763 PR libstdc++/92546 (partial)
764 * include/bits/random.h (uniform_random_bit_generator): Move definition
765 to <bits/uniform_int_dist.h>.
766 * include/bits/ranges_algo.h: Include <bits/uniform_int_dist.h> instead
767 of <bits/random.h>.
768 * include/bits/ranges_algobase.h: Do not include <cmath>.
769 * include/bits/uniform_int_dist.h (uniform_random_bit_generator):
770 Move here.
771 * include/std/ranges: Do not include <limits>.
772 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
773
c03b53da
JW
774 PR libstdc++/92546 (partial)
775 * include/Makefile.am: Add new header.
776 * include/Makefile.in: Regenerate.
777 * include/bits/int_limits.h: New header.
778 * include/bits/parse_numbers.h (__select_int::_Select_int): Replace
779 numeric_limits with __detail::__int_limits.
780 * include/std/bit (__rotl, __rotr, __countl_zero, __countl_one)
781 (__countr_zero, __countr_one, __popcount, __ceil2, __floor2, __log2p1):
782 Likewise.
783 * include/std/charconv (__to_chars_8, __from_chars_binary)
784 (__from_chars_alpha_to_num, from_chars): Likewise.
785 * include/std/memory_resource (polymorphic_allocator::allocate)
786 (polymorphic_allocator::allocate_object): Likewise.
787 * include/std/string_view (basic_string_view::_S_compare): Likewise.
788 * include/std/utility (in_range): Likewise.
789 * testsuite/20_util/integer_comparisons/in_range_neg.cc: Adjust for
790 extra error about incomplete type __int_limits<bool>.
791 * testsuite/26_numerics/bit/bit.count/countl_one.cc: Include <limits>.
792 * testsuite/26_numerics/bit/bit.count/countl_zero.cc: Likewise.
793 * testsuite/26_numerics/bit/bit.count/countr_one.cc: Likewise.
794 * testsuite/26_numerics/bit/bit.count/countr_zero.cc: Likewise.
795 * testsuite/26_numerics/bit/bit.count/popcount.cc: Likewise.
796 * testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: Likewise.
797 * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Likewise.
798 * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise.
799 * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise.
800 * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise.
801 * testsuite/26_numerics/bit/bit.rotate/rotl.cc: Likewise.
802 * testsuite/26_numerics/bit/bit.rotate/rotr.cc: Likewise.
803
4540ef78
JW
804 * python/libstdcxx/v6/printers.py (StdCmpCatPrinter.to_string): Update
805 value for partial_ordering::unordered.
806
d6dfa3da
JW
807 * include/bits/iterator_concepts.h (indirectly_copyable_storable): Add
808 const-qualified expression variations.
809 * include/std/concepts (copyable): Likewise.
810
98cf2c26
JW
811 * include/std/type_traits (__is_standard_integer): New helper trait.
812 * include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater)
813 (cmp_less_equal, cmp_greater_equal, in_range): Define for C++20.
814 * include/std/version (__cpp_lib_integer_comparison_functions): Define.
815 * testsuite/20_util/integer_comparisons/1.cc: New test.
816 * testsuite/20_util/integer_comparisons/2.cc: New test.
817 * testsuite/20_util/integer_comparisons/equal.cc: New test.
818 * testsuite/20_util/integer_comparisons/equal_neg.cc: New test.
819 * testsuite/20_util/integer_comparisons/greater_equal.cc: New test.
820 * testsuite/20_util/integer_comparisons/greater_equal_neg.cc: New test.
821 * testsuite/20_util/integer_comparisons/greater_neg.cc: New test.
822 * testsuite/20_util/integer_comparisons/in_range.cc: New test.
823 * testsuite/20_util/integer_comparisons/in_range_neg.cc: New test.
824 * testsuite/20_util/integer_comparisons/less.cc: New test.
825 * testsuite/20_util/integer_comparisons/less_equal.cc: New test.
826 * testsuite/20_util/integer_comparisons/less_equal_neg.cc: New test.
827 * testsuite/20_util/integer_comparisons/less_neg.cc: New test.
828 * testsuite/20_util/integer_comparisons/not_equal.cc: New test.
829 * testsuite/20_util/integer_comparisons/not_equal_neg.cc: New test.
830
93b8cfce
PP
8312020-02-16 Patrick Palka <ppalka@redhat.com>
832
833 * include/bits/ranges_algo.h (__lexicographical_compare_fn::operator()):
834 Move code after an early exit constexpr if to under an else branch.
835 * include/bits/ranges_algobase.h (__equal_fn::operator()): Likewise.
836
90b7eb65
PP
8372020-02-15 Patrick Palka <ppalka@redhat.com>
838
55992626
PP
839 * include/bits/ranges_algo.h: Adjust whitespace and formatting.
840 * include/bits/ranges_algobase.h: Likewise.
841 * include/bits/ranges_uninitialized.h: Likewise.
842
b40c57bd
PP
843 * include/bits/ranges_algo.h: (adjacent_find, all_of, any_of,
844 binary_search, copy_if, count, count_if, equal_range, find, find_end,
845 find_first_of, find_if, find_if_not, for_each, generate, generate_n,
846 includes, inplace_merge, is_heap, is_heap_until, is_partitioned,
847 is_permutation, is_sorted, is_sorted_until, lexicographical_compare,
848 lower_bound, make_heap, max, max_element, merge, min, min_element,
849 minmax, minmax_element, mismatch, next_permutation, none_of,
850 nth_element, partial_sort, partial_sort_copy, partition, partition_copy,
851 partition_point, pop_heap, prev_permutation, push_heap, remove,
852 remove_copy, remove_copy_if, remove_if, replace, replace_copy,
853 replace_copy_if, replace_if, reverse, reverse_copy, rotate, rotate_copy,
854 search, search_n, set_difference, set_intersection,
855 set_symmetric_difference, set_union, shuffle, sort, sort_heap,
856 stable_partition, stable_sort, swap_ranges, transform, unique,
857 unique_copy, upper_bound): Convert into function objects.
858 * include/bits/ranges_algobase.h: (equal, copy, move, copy_n, fill_n,
859 fill, move_backward, copy_backward): Likewise.
860 * include/bits/ranges_uninitialized.h (uninitialized_default_construct,
861 uninitialized_default_construct_n, uninitialized_value_construct,
862 uninitialized_value_construct_n, uninitialized_copy,
863 uninitialized_copy_n, uninitialized_move, uninitialized_move_n,
864 uninitialized_fill, uninitialized_fill_n, construct_at, destroy_at,
865 destroy, destroy_n): Likewise.
866
90b7eb65
PP
867 * include/bits/ranges_algo.h (ranges::__find_end): Fold into ...
868 (ranges::find_end): ... here.
869 (ranges::__lexicographical_compare): Fold into ...
870 (ranges::lexicographical_compare): ... here.
871 * include/bits/ranges_algobase.h (ranges::__equal): Fold into ...
872 (ranges::equal): ... here.
873
55b00d14
JW
8742020-02-15 Jonathan Wakely <jwakely@redhat.com>
875
876 * include/bits/erase_if.h (__cpp_lib_erase_if): Define to 202002L.
877 * include/std/deque: Likewise.
878 * include/std/forward_list: Likewise.
879 * include/std/list: Likewise.
880 * include/std/string: Likewise.
881 * include/std/vector: Likewise.
882 * include/std/version: Likewise.
883 * testsuite/23_containers/deque/erasure.cc: Test for new value.
884 * testsuite/23_containers/forward_list/erasure.cc: Likewise.
885 * testsuite/23_containers/list/erasure.cc: Likewise.
886 * testsuite/23_containers/map/erasure.cc: Likewise.
887 * testsuite/23_containers/set/erasure.cc: Likewise.
888 * testsuite/23_containers/unordered_map/erasure.cc: Likewise.
889 * testsuite/23_containers/unordered_set/erasure.cc: Likewise.
890 * testsuite/23_containers/vector/erasure.cc: Likewise.
891
5b1d5885
JW
8922020-02-15 Jonathan Wakely <jwakely@redhat.com>
893
894 * include/bits/random.h (uniform_random_bit_generator): Require min()
895 and max() to be constant expressions and min() to be less than max().
896 * testsuite/26_numerics/random/concept.cc: Check additional cases.
897 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
898
90fc7b3c
PP
8992020-02-13 Patrick Palka <ppalka@redhat.com>
900
613c932f
PP
901 * include/Makefile.am: Add <bits/ranges_uninitialized.h>.
902 * include/Makefile.in: Regenerate.
903 * include/bits/ranges_uninitialized.h: New header.
904 * include/std/memory: Include it.
905 * testsuite/20_util/specialized_algorithms/destroy/constrained.cc: New
906 test.
907 * .../uninitialized_copy/constrained.cc: New test.
908 * .../uninitialized_default_construct/constrained.cc: New test.
909 * .../uninitialized_fill/constrained.cc: New test.
910 * .../uninitialized_move/constrained.cc: New test.
911 * .../uninitialized_value_construct/constrained.cc: New test.
912
90fc7b3c
PP
913 * include/Makefile.am: Add bits/ranges_algobase.h
914 * include/Makefile.in: Regenerate.
915 * bits/ranges_algo.h: Include <bits/ranges_algobase.h> and refactor
916 existing #includes.
917 (__detail::__is_normal_iterator, __detail::is_reverse_iterator,
918 __detail::__is_move_iterator, copy_result, move_result,
919 __equal, equal, copy_result, move_result, move_backward_result,
920 copy_backward_result, __copy_or_move_backward, __copy_or_move, copy,
921 move, copy_backward, move_backward, copy_n_result, copy_n, fill_n,
922 fill): Split out into ...
923 * bits/range_algobase.h: ... this new header.
924
99bbab9f
PP
9252020-02-12 Patrick Palka <ppalka@redhat.com>
926
927 LWG 3389 and LWG 3390
928 * include/bits/stl_iterator.h (move_move_iterator): Use std::move when
929 constructing the move_iterator with __i.
930 (counted_iterator::counted_iterator): Use std::move when initializing
931 M_current with __i.
932 * testsuite/24_iterators/counted_iterator/lwg3389.cc: New test.
933 * testsuite/24_iterators/move_iterator/lwg3390.cc: New test.
934
02ce382c
SL
9352020-02-12 Sandra Loosemore <sandra@codesourcery.com>
936
937 PR libstdc++/79193
938 PR libstdc++/88999
939
940 * configure: Regenerated.
941
b32a3f32
FD
9422020-02-12 François Dumont <fdumont@gcc.gnu.org>
943
944 * include/bits/hashtable.h
945 (_Hashtable<>(_Hashtable&&, std::allocator_type&)): Add
946 missing std namespace qualification to forward call.
947
dcda050e
JW
9482020-02-09 Jonathan Wakely <jwakely@redhat.com>
949
38660e87
JW
950 * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Fix
951 comment.
952 * testsuite/20_util/function_objects/range.cmp/less.ccL Likewise.
953
97a7c229
JW
954 * include/std/ranges: Fix non-ASCII characters in comment.
955
dcda050e
JW
956 * include/bits/range_cmp.h (__detail::__eq_builtin_ptr_cmp): Require
957 equality comparison to be valid and return bool.
958 (__detail::__less_builtin_ptr_cmp): Likewise for less-than comparison.
959 * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Check
960 type with ambiguous conversion to fundamental types.
961 * testsuite/20_util/function_objects/range.cmp/less.cc: Likewise.
962
d222d8ec
JW
9632020-02-07 Jonathan Wakely <jwakely@redhat.com>
964
c8dd2446
JW
965 * include/bits/iterator_concepts.h (iter_difference_t, iter_value_t):
966 Use remove_cvref_t.
967 (readable_traits): Rename to indirectly_readable_traits.
968 (readable): Rename to indirectly_readable.
969 (writable): Rename to indirectly_writable.
970 (__detail::__iter_exchange_move): Do not use remove_reference_t.
971 (indirectly_swappable): Adjust requires expression parameter types.
972 expression.
973 * include/bits/ranges_algo.h (ranges::transform, ranges::replace)
974 (ranges::replace_if, ranges::generate_n, ranges::generate)
975 (ranges::remove): Use new name for writable.
976 * include/bits/stl_iterator.h (__detail::__common_iter_has_arrow):
977 Use new name for readable.
978 * include/ext/pointer.h (readable_traits<_Pointer_adapter<P>>): Use
979 new name for readable_traits.
980 * testsuite/24_iterators/associated_types/readable.traits.cc: Likewise.
981 * testsuite/24_iterators/indirect_callable/projected.cc: Adjust for
982 new definition of indirectly_readable.
983
d222d8ec
JW
984 * include/bits/stl_iterator.h (__detail::__common_iter_ptr): Change
985 to take parameters of common_iterator, instead of the common_iterator
986 type itself. Fix argument for __common_iter_has_arrow constraint.
987 (iterator_traits<common_iterator<I, S>>::pointer): Adjust.
988
572992c8
JW
9892020-02-07 Jonathan Wakely <jwakely@redhat.com>
990
991 * include/std/ranges (iota_view): Add braces to prevent -Wempty-body
992 warning.
993 (basic_istream_view::_Iterator::operator++()): Add missing return.
994
cba9ef06
PP
9952020-02-07 Patrick Palka <ppalka@redhat.com>
996
a04f635d
PP
997 * include/bits/ranges_algo.h: Remove extraneous &&.
998
b7903d9f
PP
999 * include/std/ranges (ranges::__detail::__stream_extractable,
1000 ranges::basic_istream_view, ranges::istream_view): Define.
1001 * testsuite/std/ranges/istream_view: New test.
1002
cba9ef06
PP
1003 Implement C++20 range adaptors
1004 * include/std/ranges: Include <bits/refwrap.h> and <tuple>.
1005 (subrange::_S_store_size): Mark as const instead of constexpr to
1006 avoid what seems to be a bug in GCC.
1007 (__detail::__box): Give it defaulted copy and move constructors.
55d4cbcb
PP
1008 (ranges::views::_Single::operator()): Mark constexpr.
1009 (ranges::views::_Iota::operator()): Mark constexpr.
cba9ef06 1010 (__detail::Empty): Define.
55d4cbcb
PP
1011 (ranges::views::__closure::_RangeAdaptor,
1012 ranges::views::__closure::_RangeAdaptorClosure, ref_view, all_view,
1013 ranges::views::all, ranges::__detail::find_if,
1014 ranges::__detail::find_if_not, ranges::__detail::mismatch,
1015 ranges::detail::min, filter_view, ranges::views::filter, transform_view,
1016 ranges::views::transform, take_view, ranges::views::take,
1017 take_while_view, ranges::views::take_while, drop_view,
1018 ranges::views::drop, join_view, ranges::views::join,
cba9ef06 1019 __detail::require_constant, __detail::tiny_range, split_view,
55d4cbcb
PP
1020 ranges::views::split, ranges::views::_Counted, ranges::views::counted,
1021 common_view, ranges::views::common, reverse_view,
1022 ranges::views::reverse,
1023 ranges::views::__detail::__is_reversible_subrange,
1024 ranges::views::__detail::__is_reverse_view, reverse_view,
1025 ranges::views::reverse, __detail::__has_tuple_element, elements_view,
1026 ranges::views::elements, ranges::views::keys, ranges::views::values):
1027 Define.
1028 (views): Alias for ranges::views.
1029 (tuple_size<ranges::subrange<>>, tuple_element<0, ranges::subrange>,
1030 tuple_element<1, ranges::subrange>): New partial specializations.
cba9ef06
PP
1031 * testsuite/std/ranges/adaptors/all.cc: New test.
1032 * testsuite/std/ranges/adaptors/common.cc: Likewise.
1033 * testsuite/std/ranges/adaptors/counted.cc: Likewise.
1034 * testsuite/std/ranges/adaptors/drop.cc: Likewise.
1035 * testsuite/std/ranges/adaptors/drop_while.cc: Likewise.
1036 * testsuite/std/ranges/adaptors/elements.cc: Likewise.
1037 * testsuite/std/ranges/adaptors/filter.cc: Likewise.
1038 * testsuite/std/ranges/adaptors/join.cc: Likewise.
1039 * testsuite/std/ranges/adaptors/reverse.cc: Likewise.
1040 * testsuite/std/ranges/adaptors/split.cc: Likewise.
1041 * testsuite/std/ranges/adaptors/take.cc: Likewise.
1042 * testsuite/std/ranges/adaptors/take_while.cc: Likewise.
1043 * testsuite/std/ranges/adaptors/transform.cc: Likewise.
1044
5713834e
JW
10452020-02-07 Jonathan Wakely <jwakely@redhat.com>
1046
0d57370c
JW
1047 * libsupc++/compare (__cmp_cat::type): Define typedef for underlying
1048 type of enumerations and comparison category types.
1049 (__cmp_cat::_Ord, __cmp_cat::_Ncmp): Add underlying type.
1050 (__cmp_cat::_Ncmp::unordered): Change value to 2.
1051 (partial_ordering::_M_value, weak_ordering::_M_value)
1052 (strong_ordering::_M_value): Change type to __cmp_cat::type.
1053 (partial_ordering::_M_is_ordered): Remove data member.
1054 (partial_ordering): Use second bit of _M_value for unordered. Adjust
1055 comparison operators.
1056 (weak_ordering::operator partial_ordering): Simplify to remove
1057 branches.
1058 (operator<=>(unspecified, weak_ordering)): Likewise.
1059 (strong_ordering::operator partial_ordering): Likewise.
1060 (strong_ordering::operator weak_ordering): Likewise.
1061 (operator<=>(unspecified, strong_ordering)): Likewise.
1062 * testsuite/18_support/comparisons/categories/partialord.cc: New test.
1063 * testsuite/18_support/comparisons/categories/strongord.cc: New test.
1064 * testsuite/18_support/comparisons/categories/weakord.cc: New test.
1065
5713834e
JW
1066 * include/std/ranges (iota_view::_Iterator): Fix typo in name of
1067 __cpp_lib_three_way_comparison macro and use deduced return type for
1068 operator<=>.
1069 * testsuite/std/ranges/iota/iterator.cc: New test.
1070
bc464641
PP
10712020-02-07 Patrick Palka <ppalka@redhat.com>
1072 Jonathan Wakely <jwakely@redhat.com>
1073
1074 Implement C++20 constrained algorithms
1075 * include/Makefile.am: Add new header.
1076 * include/Makefile.in: Regenerate.
1077 * include/std/algorithm: Include <bits/ranges_algo.h>.
1078 * include/bits/ranges_algo.h: New file.
1079 * testsuite/25_algorithms/adjacent_find/constrained.cc: New test.
1080 * testsuite/25_algorithms/all_of/constrained.cc: New test.
1081 * testsuite/25_algorithms/any_of/constrained.cc: New test.
1082 * testsuite/25_algorithms/binary_search/constrained.cc: New test.
1083 * testsuite/25_algorithms/copy/constrained.cc: New test.
1084 * testsuite/25_algorithms/copy_backward/constrained.cc: New test.
1085 * testsuite/25_algorithms/copy_if/constrained.cc: New test.
1086 * testsuite/25_algorithms/copy_n/constrained.cc: New test.
1087 * testsuite/25_algorithms/count/constrained.cc: New test.
1088 * testsuite/25_algorithms/count_if/constrained.cc: New test.
1089 * testsuite/25_algorithms/equal/constrained.cc: New test.
1090 * testsuite/25_algorithms/equal_range/constrained.cc: New test.
1091 * testsuite/25_algorithms/fill/constrained.cc: New test.
1092 * testsuite/25_algorithms/fill_n/constrained.cc: New test.
1093 * testsuite/25_algorithms/find/constrained.cc: New test.
1094 * testsuite/25_algorithms/find_end/constrained.cc: New test.
1095 * testsuite/25_algorithms/find_first_of/constrained.cc: New test.
1096 * testsuite/25_algorithms/find_if/constrained.cc: New test.
1097 * testsuite/25_algorithms/find_if_not/constrained.cc: New test.
1098 * testsuite/25_algorithms/for_each/constrained.cc: New test.
1099 * testsuite/25_algorithms/generate/constrained.cc: New test.
1100 * testsuite/25_algorithms/generate_n/constrained.cc: New test.
1101 * testsuite/25_algorithms/heap/constrained.cc: New test.
1102 * testsuite/25_algorithms/includes/constrained.cc: New test.
1103 * testsuite/25_algorithms/inplace_merge/constrained.cc: New test.
1104 * testsuite/25_algorithms/is_partitioned/constrained.cc: New test.
1105 * testsuite/25_algorithms/is_permutation/constrained.cc: New test.
1106 * testsuite/25_algorithms/is_sorted/constrained.cc: New test.
1107 * testsuite/25_algorithms/is_sorted_until/constrained.cc: New test.
1108 * testsuite/25_algorithms/lexicographical_compare/constrained.cc: New
1109 test.
1110 * testsuite/25_algorithms/lower_bound/constrained.cc: New test.
1111 * testsuite/25_algorithms/max/constrained.cc: New test.
1112 * testsuite/25_algorithms/max_element/constrained.cc: New test.
1113 * testsuite/25_algorithms/merge/constrained.cc: New test.
1114 * testsuite/25_algorithms/min/constrained.cc: New test.
1115 * testsuite/25_algorithms/min_element/constrained.cc: New test.
1116 * testsuite/25_algorithms/minmax/constrained.cc: New test.
1117 * testsuite/25_algorithms/minmax_element/constrained.cc: New test.
1118 * testsuite/25_algorithms/mismatch/constrained.cc: New test.
1119 * testsuite/25_algorithms/move/constrained.cc: New test.
1120 * testsuite/25_algorithms/move_backward/constrained.cc: New test.
1121 * testsuite/25_algorithms/next_permutation/constrained.cc: New test.
1122 * testsuite/25_algorithms/none_of/constrained.cc: New test.
1123 * testsuite/25_algorithms/nth_element/constrained.cc: New test.
1124 * testsuite/25_algorithms/partial_sort/constrained.cc: New test.
1125 * testsuite/25_algorithms/partial_sort_copy/constrained.cc: New test.
1126 * testsuite/25_algorithms/partition/constrained.cc: New test.
1127 * testsuite/25_algorithms/partition_copy/constrained.cc: New test.
1128 * testsuite/25_algorithms/partition_point/constrained.cc: New test.
1129 * testsuite/25_algorithms/prev_permutation/constrained.cc: New test.
1130 * testsuite/25_algorithms/remove/constrained.cc: New test.
1131 * testsuite/25_algorithms/remove_copy/constrained.cc: New test.
1132 * testsuite/25_algorithms/remove_copy_if/constrained.cc: New test.
1133 * testsuite/25_algorithms/remove_if/constrained.cc: New test.
1134 * testsuite/25_algorithms/replace/constrained.cc: New test.
1135 * testsuite/25_algorithms/replace_copy/constrained.cc: New test.
1136 * testsuite/25_algorithms/replace_copy_if/constrained.cc: New test.
1137 * testsuite/25_algorithms/replace_if/constrained.cc: New test.
1138 * testsuite/25_algorithms/reverse/constrained.cc: New test.
1139 * testsuite/25_algorithms/reverse_copy/constrained.cc: New test.
1140 * testsuite/25_algorithms/rotate/constrained.cc: New test.
1141 * testsuite/25_algorithms/rotate_copy/constrained.cc: New test.
1142 * testsuite/25_algorithms/search/constrained.cc: New test.
1143 * testsuite/25_algorithms/search_n/constrained.cc: New test.
1144 * testsuite/25_algorithms/set_difference/constrained.cc: New test.
1145 * testsuite/25_algorithms/set_intersection/constrained.cc: New test.
1146 * testsuite/25_algorithms/set_symmetric_difference/constrained.cc: New
1147 test.
1148 * testsuite/25_algorithms/set_union/constrained.cc: New test.
1149 * testsuite/25_algorithms/shuffle/constrained.cc: New test.
1150 * testsuite/25_algorithms/sort/constrained.cc: New test.
1151 * testsuite/25_algorithms/stable_partition/constrained.cc: New test.
1152 * testsuite/25_algorithms/stable_sort/constrained.cc: New test.
1153 * testsuite/25_algorithms/swap_ranges/constrained.cc: New test.
1154 * testsuite/25_algorithms/transform/constrained.cc: New test.
1155 * testsuite/25_algorithms/unique/constrained.cc: New test.
1156 * testsuite/25_algorithms/unique_copy/constrained.cc: New test.
1157 * testsuite/25_algorithms/upper_bound/constrained.cc: New test.
1158
d1aa7705
JW
11592020-02-06 Jonathan Wakely <jwakely@redhat.com>
1160
bd630df0
JW
1161 * include/bits/stl_iterator.h (__detail::__common_iter_ptr): Fix PR
1162 number in comment. Fix indentation.
1163
d1aa7705
JW
1164 * include/bits/stl_algobase.h (__iter_swap, __iter_swap<true>): Remove
1165 redundant _GLIBCXX20_CONSTEXPR.
1166
26eae9ac
JW
1167 * include/std/ranges (viewable_range): Replace decay_t with
1168 remove_cvref_t (LWG 3375).
1169
269e8130
JW
11702020-02-05 Jonathan Wakely <jwakely@redhat.com>
1171
1172 * include/bits/iterator_concepts.h (iter_reference_t)
1173 (iter_rvalue_reference_t, iter_common_reference_t, indirect_result_t):
1174 Remove workarounds for PR c++/67704.
1175 * testsuite/24_iterators/aliases.cc: New test.
1176
7db12d15
PP
11772020-02-05 Patrick Palka <ppalka@redhat.com>
1178
1179 * include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i
1180 when initializing _M_current.
1181 (move_iterator::base): Split into two overloads differing in
1182 ref-qualifiers as in P1207R4 for C++20.
1183
9962493c
JW
11842020-02-04 Jonathan Wakely <jwakely@redhat.com>
1185
9bc5bea1
JW
1186 * include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
1187 use.
1188
9962493c
JW
1189 PR libstdc++/93562
1190 * include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
1191 (unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
1192 * testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
1193
20fa702b
AB
11942020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
1195
1196 * configure: Regenerate.
1197
6e5a1963
PP
11982020-01-31 Patrick Palka <ppalka@redhat.com>
1199
1200 * testsuite/24_iterators/range_operations/distance.cc: Do not assume
1201 test_range::end() returns the same type as test_range::begin().
1202 * testsuite/24_iterators/range_operations/next.cc: Likewise.
1203 * testsuite/24_iterators/range_operations/prev.cc: Likewise.
1204 * testsuite/util/testsuite_iterators.h (__gnu_test::test_range::end):
1205 Always return a sentinel<I>.
1206
5cd2e126
JW
12072020-01-29 Jonathan Wakely <jwakely@redhat.com>
1208
0a8f4feb
JW
1209 PR libstdc++/92895
1210 * include/std/stop_token (stop_token::stop_possible()): Call new
1211 _M_stop_possible() function.
1212 (stop_token::stop_requested()): Do not use stop_possible().
1213 (stop_token::binary_semaphore): New class, as temporary stand-in for
1214 std::binary_semaphore.
1215 (stop_token::_Stop_cb::_M_callback): Add noexcept to type.
1216 (stop_token::_Stop_cb::_M_destroyed, stop_token::_Stop_cb::_M_done):
1217 New data members for symchronization with stop_callback destruction.
1218 (stop_token::_Stop_cb::_Stop_cb): Make non-template.
1219 (stop_token::_Stop_cb::_M_linked, stop_token::_Stop_cb::_S_execute):
1220 Remove.
1221 (stop_token::_Stop_cb::_M_run): New member function.
1222 (stop_token::_Stop_state::_M_stopped, stop_token::_Stop_state::_M_mtx):
1223 Remove.
1224 (stop_token::_Stop_state::_M_owners): New data member to track
1225 reference count for ownership.
1226 (stop_token::_Stop_state::_M_value): New data member combining a
1227 spinlock, the stop requested flag, and the reference count for
1228 associated stop_source objects.
1229 (stop_token::_Stop_state::_M_requester): New data member for
1230 synchronization with stop_callback destruction.
1231 (stop_token::_Stop_state::_M_stop_possible()): New member function.
1232 (stop_token::_Stop_state::_M_stop_requested()): Inspect relevant bit
1233 of _M_value.
1234 (stop_token::_Stop_state::_M_add_owner)
1235 (stop_token::_Stop_state::_M_release_ownership)
1236 (stop_token::_Stop_state::_M_add_ssrc)
1237 (stop_token::_Stop_state::_M_sub_ssrc): New member functions for
1238 updating reference counts.
1239 (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
1240 (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
1241 (stop_token::_Stop_state::_M_try_lock)
1242 (stop_token::_Stop_state::_M_try_lock_and_stop)
1243 (stop_token::_Stop_state::_M_do_try_lock): New member functions for
1244 managing spinlock.
1245 (stop_token::_Stop_state::_M_request_stop): Use atomic operations to
1246 read and update state. Release lock while running callbacks. Use new
1247 data members to synchronize with callback destruction.
1248 (stop_token::_Stop_state::_M_remove_callback): Likewise.
1249 (stop_token::_Stop_state::_M_register_callback): Use atomic operations
1250 to read and update state.
1251 (stop_token::_Stop_state_ref): Handle type to manage _Stop_state,
1252 replacing shared_ptr.
1253 (stop_source::stop_source(const stop_source&)): Update reference count.
1254 (stop_source::operator=(const stop_source&)): Likewise.
1255 (stop_source::~stop_source()): Likewise.
1256 (stop_source::stop_source(stop_source&&)): Define as defaulted.
1257 (stop_source::operator=(stop_source&&)): Establish postcondition on
1258 parameter.
1259 (stop_callback): Enforce preconditions on template parameter. Replace
1260 base class with data member of new _Cb_impl type.
1261 (stop_callback::stop_callback(const stop_token&, Cb&&))
1262 (stop_callback::stop_callback(stop_token&&, Cb&&)): Fix TOCTTOU race.
1263 (stop_callback::_Cb_impl): New type wrapping _Callback member and
1264 defining the _S_execute member function.
1265 * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc: New
1266 test.
1267 * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: New test.
1268 * testsuite/30_threads/stop_token/stop_callback/destroy.cc: New test.
1269 * testsuite/30_threads/stop_token/stop_callback/destructible_neg.cc:
1270 New test.
1271 * testsuite/30_threads/stop_token/stop_callback/invocable_neg.cc: New
1272 test.
1273 * testsuite/30_threads/stop_token/stop_callback/invoke.cc: New test.
1274 * testsuite/30_threads/stop_token/stop_source/assign.cc: New test.
1275 * testsuite/30_threads/stop_token/stop_token/stop_possible.cc: New
1276 test.
1277
f214ffb3
JW
1278 * libsupc++/compare (__detail::__3way_builtin_ptr_cmp): Use
1279 three_way_comparable_with.
1280 (__detail::__3way_cmp_with): Remove workaround for fixed bug.
1281 (compare_three_way::operator()): Remove redundant constraint from
1282 requires-clause.
1283 (__detail::_Synth3way::operator()): Use three_way_comparable_with
1284 instead of workaround.
1285 * testsuite/18_support/comparisons/object/93479.cc: Prune extra
1286 output due to simplified constraints on compare_three_way::operator().
1287
83b02010
JW
1288 PR libstdc++/93479
1289 * libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid.
1290 * testsuite/18_support/comparisons/object/93479.cc: New test.
1291
5cd2e126
JW
1292 * testsuite/std/ranges/access/end.cc: Do not assume test_range::end()
1293 returns the same type as test_range::begin(). Add comments.
1294 * testsuite/std/ranges/access/rbegin.cc: Likewise.
1295 * testsuite/std/ranges/access/rend.cc: Likewise.
1296 * testsuite/std/ranges/range.cc: Do not assume the sentinel for
1297 test_range is the same as its iterator type.
1298 * testsuite/util/testsuite_iterators.h (test_range::sentinel): Add
1299 operator- overloads to satisfy sized_sentinel_for when the iterator
1300 satisfies random_access_iterator.
1301
759812fd
JW
13022020-01-28 Jonathan Wakely <jwakely@redhat.com>
1303
72a9fd20
JW
1304 PR libstdc++/93470
1305 * include/bits/refwrap.h (reference_wrapper::operator()): Restrict
1306 static assertion to object types.
1307
759812fd
JW
1308 PR libstdc++/93325
1309 * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
1310 clock_gettime instead of explicit glibc version check.
1311 * configure: Regenerate.
1312
a5d81aaa
JW
13132020-01-28 Martin Liska <mliska@suse.cz>
1314
1315 PR libstdc++/93478
1316 * include/std/atomic: Fix typo.
1317 * include/std/optional: Likewise.
1318
13192020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
1320
1321 * configure: Regenerate.
1322
389cd88c
JW
13232020-01-27 Jonathan Wakely <jwakely@redhat.com>
1324
1325 PR libstdc++/93426
1326 * include/std/span (span): Fix deduction guide.
1327 * testsuite/23_containers/span/deduction.cc: New test.
1328
482eeff5
JW
13292020-01-24 Jonathan Wakely <jwakely@redhat.com>
1330
1331 * libsupc++/compare (__cmp_cat::_Eq): Remove enumeration type.
1332 (__cmp_cat::_Ord::equivalent): Add enumerator.
1333 (__cmp_cat::_Ord::_Less, __cmp_cat::_Ord::_Greater): Rename to less
1334 and greater.
1335 (partial_ordering, weak_ordering, strong_ordering): Remove
1336 constructors taking __cmp_cat::_Eq parameters. Use renamed
1337 enumerators.
1338
e8e66971
MR
13392020-01-24 Maciej W. Rozycki <macro@wdc.com>
1340
1341 * acinclude.m4: Handle `--with-toolexeclibdir='.
1342 * Makefile.in: Regenerate.
1343 * aclocal.m4: Regenerate.
1344 * configure: Regenerate.
1345 * doc/Makefile.in: Regenerate.
1346 * include/Makefile.in: Regenerate.
1347 * libsupc++/Makefile.in: Regenerate.
1348 * po/Makefile.in: Regenerate.
1349 * python/Makefile.in: Regenerate.
1350 * src/Makefile.in: Regenerate.
1351 * src/c++11/Makefile.in: Regenerate.
1352 * src/c++17/Makefile.in: Regenerate.
1353 * src/c++98/Makefile.in: Regenerate.
1354 * src/filesystem/Makefile.in: Regenerate.
1355 * testsuite/Makefile.in: Regenerate.
1356
7a900bce
AO
13572020-01-23 Alexandre Oliva <oliva@adacore.com>
1358
f9e84b31
AO
1359 * crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Reject macros.
1360 * configure: Rebuild.
1361
7a900bce
AO
1362 * testsuite/27_io/fpos/mbstate_t/1.cc: Zero-init mbstate_t.
1363
04681fca
JW
13642020-01-23 Jonathan Wakely <jwakely@redhat.com>
1365
1366 PR libstdc++/91947
1367 * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
1368 rule.
1369 * include/Makefile.in: Regenerate.
1370
c784f162
JW
13712020-01-20 Jonathan Wakely <jwakely@redhat.com>
1372
1373 * doc/xml/faq.xml: Fix grammar.
1374 * doc/xml/manual/appendix_contributing.xml: Improve instructions.
1375 * doc/xml/manual/spine.xml: Update copyright years.
1376 * doc/html/*: Regenerate.
1377
f4d83eba
ER
13782020-01-19 Eric S. Raymond <esr@thyrsus.com>
1379
1380 * doc/xml/faq.xml: Update for SVN -> Git transition.
1381 * doc/xml/manual/appendix_contributing.xml: Likewise.
1382 * doc/xml/manual/status_cxx1998.xml: Likewise.
1383 * doc/xml/manual/status_cxx2011.xml: Likewise.
1384 * doc/xml/manual/status_cxx2014.xml: Likewise.
1385 * doc/xml/manual/status_cxx2017.xml: Likewise.
1386 * doc/xml/manual/status_cxx2020.xml: Likewise.
1387 * doc/xml/manual/status_cxxtr1.xml: Likewise.
1388 * doc/xml/manual/status_cxxtr24733.xml: Likewise.
1389
49789fd0
IS
13902020-01-18 Iain Sandoe <iain@sandoe.co.uk>
1391
1392 * include/Makefile.am: Add coroutine to the std set.
1393 * include/Makefile.in: Regenerated.
1394 * include/std/coroutine: New file.
1395
0ba6a850
JW
13962020-01-17 Jonathan Wakely <jwakely@redhat.com>
1397
1398 PR libstdc++/92376
1399 * include/bits/c++config: Only do PSTL config when the header is
1400 present, to fix freestanding.
1401 * libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
1402 functions if they were detected by configure.
1403
98d56ea8
JW
14042020-01-16 Kai-Uwe Eckhardt <kuehro@gmx.de>
1405 Matthew Bauer <mjbauer95@gmail.com>
1406 Jonathan Wakely <jwakely@redhat.com>
1407
1408 PR bootstrap/64271 (partial)
1409 * config/os/bsd/netbsd/ctype_base.h (ctype_base::mask): Change type
1410 to unsigned short.
1411 (ctype_base::alpha, ctype_base::digit, ctype_base::xdigit)
1412 (ctype_base::print, ctype_base::graph, ctype_base::alnum): Sync
1413 definitions with NetBSD upstream.
1414 (ctype_base::blank): Use _CTYPE_BL.
1415 * config/os/bsd/netbsd/ctype_configure_char.cc (_C_ctype_): Remove
1416 Declaration.
1417 (ctype<char>::classic_table): Use _C_ctype_tab_ instead of _C_ctype_.
1418 (ctype<char>::do_toupper, ctype<char>::do_tolower): Cast char
1419 parameters to unsigned char.
1420 * config/os/bsd/netbsd/ctype_inline.h (ctype<char>::is): Likewise.
1421
d9165389
FD
14222020-01-16 François Dumont <fdumont@gcc.gnu.org>
1423
1424 PR libstdc++/91263
1425 * include/bits/hashtable.h (_Hashtable<>): Make _Equality<> friend.
1426 * include/bits/hashtable_policy.h: Include <bits/stl_algo.h>.
1427 (_Equality_base): Remove.
1428 (_Equality<>::_M_equal): Review implementation. Use
1429 std::is_permutation.
1430 * testsuite/23_containers/unordered_multiset/operators/1.cc
1431 (Hash, Equal, test02, test03): New.
1432 * testsuite/23_containers/unordered_set/operators/1.cc
1433 (Hash, Equal, test02, test03): New.
1434
2a0f6c61
JW
14352020-01-15 Jonathan Wakely <jwakely@redhat.com>
1436
1437 PR libstdc++/93267
1438 * include/bits/iterator_concepts.h (__max_diff_type, __max_size_type):
1439 Move here from <bits/range_access.h> and define using __int128 when
1440 available.
1441 (__is_integer_like, __is_signed_integer_like): Move here from
1442 <bits/range_access.h>.
1443 (weakly_incrementable): Use __is_signed_integer_like.
1444 * include/bits/range_access.h (__max_diff_type, __max_size_type)
1445 (__is_integer_like, __is_signed_integer_like): Move to
1446 <bits/iterator_concepts.h>.
1447 (__make_unsigned_like_t): Move here from <ranges>.
1448 * include/std/ranges (__make_unsigned_like_t): Move to
1449 <bits/range_access.h>.
1450 (iota_view): Replace using-directive with using-declarations.
1451 * testsuite/std/ranges/iota/93267.cc: New test.
1452 * testsuite/std/ranges/iota_view.cc: Move to new 'iota' sub-directory.
1453
e4379a93
JW
14542020-01-13 Jonathan Wakely <jwakely@redhat.com>
1455
fe7cc34f
JW
1456 PR libstdc++/93244
1457 * include/bits/fs_path.h (path::generic_string<C,A>)
1458 [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
1459 * testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
1460 root-dir is converted to forward slash in generic pathname.
1461 * testsuite/27_io/filesystem/path/generic/utf.cc: New test.
1462 * testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.
1463
e4379a93
JW
1464 PR libstdc++/58605
1465 * include/bits/atomic_base.h (__cpp_lib_atomic_value_initialization):
1466 Define.
1467 (__atomic_flag_base, __atomic_base, __atomic_base<_PTp*>)
1468 (__atomic_float): Add default member initializer for C++20.
1469 * include/std/atomic (atomic): Likewise.
1470 (atomic::atomic()): Remove noexcept-specifier on default constructor.
1471 * include/std/version (__cpp_lib_atomic_value_initialization): Define.
1472 * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error line
1473 number.
1474 * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
1475 * testsuite/29_atomics/atomic/cons/value_init.cc: New test.
1476 * testsuite/29_atomics/atomic_flag/cons/value_init.cc: New test.
1477 * testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Adjust
1478 expected result for is_trivially_default_constructible.
1479 * testsuite/29_atomics/atomic_float/requirements.cc: Likewise.
1480 * testsuite/29_atomics/atomic_float/value_init.cc: New test.
1481 * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise.
1482 * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
1483 * testsuite/29_atomics/atomic_integral/cons/value_init.cc
1484 * testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Adjust
1485 expected results for is_trivially_default_constructible.
1486 * testsuite/util/testsuite_common_types.h (has_trivial_dtor): Add
1487 new test generator.
1488
7918cb93
JW
14892020-01-10 Jonathan Wakely <jwakely@redhat.com>
1490
68be73fc
JW
1491 * testsuite/util/testsuite_iterators.h: Improve comment.
1492
78f02e80
JW
1493 * testsuite/25_algorithms/equal/deque_iterators/1.cc: Don't use C++11
1494 initialization syntax.
1495
7918cb93
JW
1496 PR libstdc++/92285
1497 * include/bits/streambuf_iterator.h (istreambuf_iterator): Make type
1498 of base class independent of __cplusplus value.
1499 [__cplusplus < 201103L] (istreambuf_iterator::reference): Override the
1500 type defined in the base class
1501 * testsuite/24_iterators/istreambuf_iterator/92285.cc: New test.
1502 * testsuite/24_iterators/istreambuf_iterator/requirements/
1503 base_classes.cc: Adjust expected base class for C++98.
1504
acd43917
OH
15052020-01-09 Olivier Hainque <hainque@adacore.com>
1506
1507 * doc/xml/manual/appendix_contributing.xml: Document _C2
1508 as a reserved identifier, by VxWorks.
1509 * include/bits/stl_map.h: Rename _C2 template typenames as _Cmp2.
1510 * include/bits/stl_multimap.h: Likewise.
1511
caa39b2e
JW
15122020-01-09 Jonathan Wakely <jwakely@redhat.com>
1513
1a788638
JW
1514 * include/ext/extptr_allocator.h (_ExtPtr_allocator::operator==)
1515 (_ExtPtr_allocator::operator!=): Add missing const qualifiers.
1516 * include/ext/pointer.h (readable_traits<_Pointer_adapter<S>>): Add
1517 partial specialization to disambiguate the two constrained
1518 specializations.
1519
caa39b2e
JW
1520 * include/experimental/type_traits (experimental::is_pod_v): Disable
1521 -Wdeprecated-declarations warnings around reference to std::is_pod.
1522 * include/std/type_traits (is_pod_v): Likewise.
1523 * testsuite/18_support/max_align_t/requirements/2.cc: Also check
1524 is_standard_layout and is_trivial. Do not check is_pod for C++20.
1525 * testsuite/20_util/is_pod/requirements/explicit_instantiation.cc:
1526 Add -Wno-deprecated for C++20.
1527 * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
1528 * testsuite/20_util/is_pod/value.cc: Likewise.
1529 * testsuite/experimental/type_traits/value.cc: Likewise.
1530
1a6c5064
JTM
15312020-01-09 JeanHeyd "ThePhD" Meneide <phdofthehouse@gmail.com>
1532
1533 * include/bits/c++config (_GLIBCXX20_DEPRECATED): Add new macro.
1534 * include/std/type_traits (is_pod, is_pod_v): Deprecate for C++20.
1535 * testuite/20_util/is_pod/deprecated-2a.cc: New test.
1536
d574c8aa
JW
15372020-01-09 Jonathan Wakely <jwakely@redhat.com>
1538
160e95dc
JW
1539 PR libstdc++/93205
1540 * include/bits/random.h (operator>>): Check stream operation succeeds.
1541 * include/bits/random.tcc (operator<<): Remove redundant __ostream_type
1542 typedefs.
1543 (operator>>): Remove redundant __istream_type typedefs. Check stream
1544 operations succeed.
1545 (__extract_params): New function to fill a vector from a stream.
1546 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.
1547
d574c8aa
JW
1548 PR libstdc++/93208
1549 * config/abi/pre/gnu.ver: Add new exports.
1550 * include/std/memory_resource (memory_resource::~memory_resource()):
1551 Do not define inline.
1552 (monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
1553 * src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
1554 Define.
1555 (monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
1556 * testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.
1557
b9c84e95
FD
15582020-01-09 François Dumont <fdumont@gcc.gnu.org>
1559
1560 PR libstdc++/92124
1561 * include/bits/hashtable.h (_Hashtable<>::__alloc_node_gen_t): New
1562 template alias.
1563 (_Hashtable<>::__fwd_value_for): New.
1564 (_Hashtable<>::_M_assign_elements<>): Remove _NodeGenerator template
1565 parameter.
1566 (_Hashtable<>::_M_assign<>): Add _Ht template parameter.
1567 (_Hashtable<>::operator=(const _Hashtable<>&)): Adapt.
1568 (_Hashtable<>::_M_move_assign): Adapt. Replace std::move_if_noexcept
1569 with std::move.
1570 (_Hashtable<>::_Hashtable(const _Hashtable&)): Adapt.
1571 (_Hashtable<>::_Hashtable(const _Hashtable&, const allocator_type&)):
1572 Adapt.
1573 (_Hashtable<>::_Hashtable(_Hashtable&&, const allocator_type&)):
1574 Adapt.
1575 * testsuite/23_containers/unordered_set/92124.cc: New.
1576
fff148b7
JW
15772020-01-08 Jonathan Wakely <jwakely@redhat.com>
1578
1579 PR libstdc++/93201
1580 * src/c++17/fs_ops.cc (do_remove_all): New function implementing more
1581 detailed error reporting for remove_all. Check result of recursive
1582 call before incrementing iterator.
1583 (remove_all(const path&), remove_all(const path&, error_code&)): Use
1584 do_remove_all.
1585 * src/filesystem/ops.cc (remove_all(const path&, error_code&)): Check
1586 result of recursive call before incrementing iterator.
1587 * testsuite/27_io/filesystem/operations/remove_all.cc: Check errors
1588 are reported correctly.
1589 * testsuite/experimental/filesystem/operations/remove_all.cc: Likewise.
1590
9e3c1eb7
TR
15912020-01-07 Thomas Rodgers <trodgers@redhat.com>
1592
1593 * include/std/condition_variable
1594 (condition_variable_any::wait_on): Rename to match current draft
1595 standard.
1596 (condition_variable_any::wait_on_until): Likewise.
1597 (condition_variable_any::wait_on_for): Likewise.
1598 * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
1599 Adjust tests to account for renamed methods.
1600
6af8819b
FD
16012020-01-07 François Dumont <fdumont@gcc.gnu.org>
1602
1603 PR libstdc++/92124
1604 * include/bits/stl_tree.h
1605 (_Rb_tree<>::_M_move_assign(_Rb_tree&, false_type)): Replace
1606 std::move_if_noexcept by std::move.
1607 * testsuite/23_containers/map/92124.cc: New.
1608 * testsuite/23_containers/set/92124.cc: New.
1609
f31a99f7
JW
16102020-01-06 Jonathan Wakely <jwakely@redhat.com>
1611
a4a1f965
JW
1612 * include/std/stop_token (stop_token): Remove operator!= (LWG 3254).
1613 (stop_source): Likewise (LWG 3362).
1614 * testsuite/30_threads/stop_token/stop_source.cc: Test equality
1615 comparisons.
1616
f31a99f7
JW
1617 * include/bits/stl_algobase.h (__is_byte_iter, __min_cmp)
1618 (lexicographical_compare_three_way): Do not depend on
1619 __cpp_lib_concepts.
1620 * include/std/version (__cpp_lib_three_way_comparison): Only define
1621 when __cpp_lib_concepts is defined.
1622 * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise.
1623
b4e70137
JW
16242020-01-03 Jonathan Wakely <jwakely@redhat.com>
1625
1626 * include/bits/stl_algobase.h (lexicographical_compare_three_way):
1627 Only define four-argument overload when __cpp_lib_concepts is defined.
1628
a8497ec6
JDA
16292020-01-01 John David Anglin <danglin@gcc.gnu.org>
1630
1631 * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
1632
8d9254fc 16332020-01-01 Jakub Jelinek <jakub@redhat.com>
5624e564
JJ
1634
1635 Update copyright years.
b4df5e92 1636\f
8d9254fc 1637Copyright (C) 2020 Free Software Foundation, Inc.
b4df5e92
JW
1638
1639Copying and distribution of this file, with or without modification,
1640are permitted in any medium without royalty provided the copyright
1641notice and this notice are preserved.