1 2020-06-24 Jonathan Wakely <jwakely@redhat.com>
3 * include/std/charconv (__from_chars_binary): Ignore leading zeros.
4 * testsuite/20_util/from_chars/1.cc: Check "0x1" for all bases,
6 * testsuite/20_util/from_chars/3.cc: New test.
8 2020-06-24 Jonathan Wakely <jwakely@redhat.com>
10 * include/bits/stl_algobase.h (__find_if): Add FALLTHRU markers.
11 * include/std/charconv (__detail::__to_chars): Avoid
12 -Wsign-compare warning.
14 2020-06-24 Jonathan Wakely <jwakely@redhat.com>
17 * include/std/charconv (__to_chars_i): Check for zero-sized
18 buffer unconditionally.
19 * testsuite/20_util/to_chars/95851.cc: New test.
21 2020-06-23 Jonathan Wakely <jwakely@redhat.com>
23 * testsuite/20_util/from_chars/1_c++20_neg.cc: Check enumeration
25 * testsuite/20_util/from_chars/1_neg.cc: Likewise. Move dg-error
26 directives outside preprocessor condition.
28 2020-06-23 Jonathan Wakely <jwakely@redhat.com>
31 * include/std/variant (__detail::__variant::_Build_FUN): Remove
32 partial specialization to prevent narrowing conversions to bool.
33 * testsuite/20_util/variant/compile.cc: Test non-narrowing
35 * testsuite/20_util/variant/run.cc: Likewise.
37 2020-06-23 Jonathan Wakely <jwakely@redhat.com>
39 * doc/Makefile.in: Regenerate.
40 * include/Makefile.in: Regenerate.
41 * libsupc++/Makefile.in: Regenerate.
42 * po/Makefile.in: Regenerate.
43 * python/Makefile.in: Regenerate.
44 * src/Makefile.in: Regenerate.
45 * src/c++11/Makefile.in: Regenerate.
46 * src/c++17/Makefile.in: Regenerate.
47 * src/c++98/Makefile.in: Regenerate.
48 * src/filesystem/Makefile.in: Regenerate.
49 * testsuite/Makefile.in: Regenerate.
51 2020-06-22 David Edelsohn <dje.gcc@gmail.com>
53 * Makefile.am: Use -include.
54 * Makefile.in: Regenerate.
56 2020-06-21 David Edelsohn <dje.gcc@gmail.com>
58 * Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
59 * Makefile.in: Regenerate.
60 * configure.ac (tmake_file): Substitute.
61 * configure: Regenerate.
62 * configure.host (aix*): Define tmake_file.
63 * config/os/aix/t-aix: New file.
65 2020-06-20 Jason Merrill <jason@redhat.com>
67 * testsuite/24_iterators/move_iterator/rel_ops_c++20.cc:
68 Remove greedy_ops tests.
69 * testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc:
70 Remove greedy_ops tests.
72 2020-06-19 Jonathan Wakely <jwakely@redhat.com>
75 * include/bits/stl_algobase.h (__size_to_integer(float))
76 (__size_to_integer(double), __size_to_integer(long double))
77 (__size_to_integer(__float128)): Cast return type explicitly.
78 * include/bits/stl_uninitialized.h (__uninitialized_default_1<true>):
79 Remove unused typedef.
81 2020-06-19 Jonathan Wakely <jwakely@redhat.com>
83 * include/bits/stl_pair.h (_Index_tuple): Remove redundant
84 namespace qualification.
85 (pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)):
87 * include/std/tuple (_Head_base, _Tuple_impl, tuple_size)
88 (tuple_element, __get_helper, get, __make_tuple_impl)
89 (__make_1st_indices, __tuple_concater)
90 (pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)):
92 * include/std/utility (tuple_element, __is_tuple_like_impl)
93 (tuple_size, __pair_get, get): Likewise.
95 2020-06-19 Jonathan Wakely <jwakely@redhat.com>
97 * include/bits/std_function.h (function): Define all member
100 2020-06-19 Marc Glisse <marc.glisse@inria.fr>
102 * include/bits/stl_algo.h (__includes): Simplify the code.
104 2020-06-19 Marc Glisse <marc.glisse@inria.fr>
106 * include/std/optional (optional()): Explicitly define it.
108 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
111 * include/bits/stl_uninitialized.h (__uninitialized_default_1<true>):
112 Construct the first value at *__first instead of on the stack.
113 (__uninitialized_default_n_1<true>): Likewise.
114 Improve comments on several of the non-standard algorithms.
115 * testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc:
117 * testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc:
119 * testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc:
121 * testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc:
123 * testsuite/23_containers/vector/cons/94540.cc: New test.
125 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
127 * testsuite/20_util/specialized_algorithms/uninitialized_default_n/sizes.cc:
128 Replace Value type with int so trivial code path is used.
129 * testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc:
132 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
134 * include/bits/stl_uninitialized.h (uninitialized_fill_n): Only
135 use std::fill_n when the size is an integral type.
136 (__uninitialized_default_n): Likewise.
137 * testsuite/20_util/specialized_algorithms/uninitialized_default_n/sizes.cc:
139 * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc:
141 * testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc:
144 2020-06-16 Jonathan Wakely <jwakely@redhat.com>
147 * include/bits/atomic_base.h (__atomic_impl::load): Use the _Val
148 alias instead of deducing _Tp as an unqualified type.
149 (__atomic_impl::exchange): Use the _Val alias to remove volatile
150 from the reinterpret_cast result type.
152 2020-06-16 Jonathan Wakely <jwakely@redhat.com>
154 * include/std/atomic (atomic): Add static assertions.
155 * testsuite/29_atomics/atomic/requirements/types_neg.cc: New test.
157 2020-06-16 Patrick Palka <ppalka@redhat.com>
160 * testsuite/20_util/is_constructible/94003.cc: New test.
162 2020-06-15 Jonathan Wakely <jwakely@redhat.com>
164 * include/bits/char_traits.h (__cpp_lib_constexpr_char_traits):
165 Update value for C++20.
166 * include/std/version (__cpp_lib_constexpr_char_traits): Likewise.
167 * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
168 Update expected value.
169 * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
172 2020-06-15 Paul Keir <paul.keir@uws.ac.uk>
174 * include/bits/char_traits.h (char_traits::move): constexpr move with
175 overlap was using copy_backward incorrectly.
176 * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
179 2020-06-12 Jonathan Wakely <jwakely@redhat.com>
181 * testsuite/29_atomics/atomic_flag/clear/1.cc: Also test clear()
182 when the value is currently set.
183 * testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc:
184 Actually check the return value.
185 * testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc:
188 2020-06-12 Jonathan Wakely <jwakely@redhat.com>
190 * include/bits/atomic_base.h (atomic_flag::test): Add missing
192 * testsuite/29_atomics/atomic_flag/test/explicit.cc: Add
193 dg-options and verify results of test function.
194 * testsuite/29_atomics/atomic_flag/test/implicit.cc: Likewise.
196 2020-06-11 Jonathan Wakely <jwakely@redhat.com>
199 * include/bits/istream.tcc (basic_istream::ignore(streamsize, CharT)):
200 Only discard an extra character if we didn't already reach the
202 * src/c++98/istream.cc (istream::ignore(streamsiz, char))
203 (wistream::ignore(streamsize, wchar_t)): Likewise.
204 * testsuite/27_io/basic_istream/ignore/char/94749.cc: New test.
205 * testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc: New test.
207 2020-06-10 Patrick Palka <ppalka@redhat.com>
210 * include/bits/ranges_algo.h (__lexicographical_compare_fn):
211 Also check that the iterator and sentinel have the same type before
212 applying the unwrapping optimization for __normal_iterator.
213 Split the check into two, one for the first iterator/sentinel
214 pair and another for second iterator/sentinel pair. Remove uses
215 of __niter_base, and remove uses of std::move on a
217 * include/bits/ranges_algobase.h (__equal_fn): Likewise.
218 (__copy_or_move): Likewise. Perform similar adjustments for
219 the reverse_iterator and move_iterator optimizations. Inline
220 the checks into the if-constexprs, and use using-declarations to
221 make them less visually noisy. Remove uses of __niter_wrap.
222 (__copy_or_move_backward): Likewise.
223 * testsuite/25_algorithms/copy/95578.cc: New test.
224 * testsuite/25_algorithms/copy_backward/95578.cc: New test.
225 * testsuite/25_algorithms/equal/95578.cc: New test.
226 * testsuite/25_algorithms/lexicographical_compare/95578.cc: New test.
227 * testsuite/25_algorithms/move/95578.cc: New test.
228 * testsuite/25_algorithms/move_backward/95578.cc: New test.
230 2020-06-10 François Dumont <fdumont@gcc.gnu.org>
231 Jonathan Wakely <jwakely@redhat.com>
233 * include/bits/deque.tcc (__lex_cmp_dit): New.
234 (__lexicographical_compare_aux1): Define overloads for deque
236 * include/bits/stl_algobase.h (__lexicographical_compare::__3way):
237 New static member function.
238 (__lexicographical_compare<true>::__3way): Likewise.
239 (__lexicographical_compare<true>::__lc): Use __3way.
240 (__lexicographical_compare_aux): Rename to
241 __lexicographical_compare_aux1 and declare overloads for deque
243 (__lexicographical_compare_aux): Define new forwarding function
244 that calls __lexicographical_compare_aux1 and declare new overloads
246 (lexicographical_compare): Do not use __niter_base on
248 * include/debug/safe_iterator.tcc
249 (__lexicographical_compare_aux): Define overloads for safe
251 * testsuite/25_algorithms/lexicographical_compare/1.cc: Add
252 checks with random access iterators.
253 * testsuite/25_algorithms/lexicographical_compare/deque_iterators/1.cc:
256 2020-06-09 Jonathan Wakely <jwakely@redhat.com>
258 * include/bits/stl_iterator.h (move_iterator::operator=): Define.
259 * testsuite/24_iterators/move_iterator/dr3265.cc: New test.
261 2020-06-09 Jonathan Wakely <jwakely@redhat.com>
263 * include/std/optional (bad_optional_access): Define default
264 constructor and destructor as defaulted.
265 * testsuite/20_util/optional/bad_access.cc: New test.
267 2020-06-08 Jonathan Wakely <jwakely@redhat.com>
269 * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error
271 * testsuite/20_util/default_delete/void_neg.cc: Likewise.
273 2020-06-08 Jonathan Wakely <jwakely@redhat.com>
275 * include/bits/unique_ptr.h (operator<<): Define for C++20.
276 * testsuite/20_util/unique_ptr/io/lwg2948.cc: New test.
278 2020-06-04 Jonathan Wakely <jwakely@redhat.com>
280 * include/bits/iterator_concepts.h (__detail::__ptr, __detail::__ref)
281 (__detail::__cat, __detail::__diff): Move to class scope in the
282 relevant __iterator_traits specializations.
283 (__iterator_traits<>): Use nested class templates instead of ones from
285 * include/bits/stl_iterator.h (__detail::__common_iter_ptr): Move to
286 class scope in iterator_traits<common_iterator<I, S>>.
287 (iterator_traits<common_iterator<I, S>>): Use nested class template
288 instead of __detail::__common_iter_ptr.
290 2020-06-04 François Dumont <fdumont@gcc.gnu.org>
292 * include/bits/stl_algo.h (__copy_n_a): Move to ...
293 * include/bits/stl_algobase.h (__copy_n_a): ...here. Add __strict
295 (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)):
297 (__niter_base(const _Safe_iterator<_Ite, _Seq,
298 random_access_iterator_tag>&)): Declare.
299 (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>,
300 _Deque_iterator<>)): Declare.
301 * include/bits/deque.tcc
302 (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>,
303 _Deque_iterator<>)): New.
304 (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)):
306 * include/bits/streambuf_iterator.h
307 (__copy_n_a(istreambuf_iterator<>, _Size, _CharT*, bool)): Adapt.
308 * include/debug/safe_iterator.tcc (__niter_base): New.
309 * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
311 * testsuite/25_algorithms/copy/streambuf_iterators/char/debug/deque_neg.cc:
313 * testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc:
315 * testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc: New test.
316 * testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc:
319 2020-06-04 Jonathan Wakely <jwakely@redhat.com>
321 * include/bits/ranges_algobase.h (__copy_n_fn): Only call
322 ranges::copy for positive values.
323 * include/bits/stl_algo.h (copy_n): Convert Size argument to an
324 integral type and only call __copy_n for positive values.
325 * testsuite/util/testsuite_iterators.h
326 (random_access_iterator_wrapper::operator+=): Fix range check for
328 (output_container, input_container, forward_container)
329 (bidirectional_container, random_access_container): New alias
331 * testsuite/25_algorithms/copy_n/5.cc: New test.
333 2020-06-02 Jonathan Wakely <jwakely@redhat.com>
336 * include/debug/deque (deque(const _Base&)): Replace parameter
337 with a struct that wraps a const _Base&.
338 * include/debug/forward_list (forward_list(_Base_ref)): New
340 * include/debug/list (list(const _Base&)): Replace parameter
341 with a struct that wraps a const _Base&.
342 * include/debug/map.h (map(const _Base&)): Likewise.
343 * include/debug/multimap.h (multimap(const _Base&)): Likewise.
344 * include/debug/multiset.h (multiset(const _Base&)): Likewise.
345 * include/debug/set.h (set(const _Base&)): Likewise.
346 * include/debug/unordered_map (unordered_map(const _Base&))
347 (unordered_multimap(const _Base&)): Likewise.
348 * include/debug/unordered_set (unordered_set(const _Base&))
349 (unordered_multiset(const _Base&)): Likewise.
350 * testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
351 Adjust dg-error line number.
352 * include/debug/vector (vector(const _Base&)): Likewise.
353 * testsuite/23_containers/deque/debug/90102.cc: New test.
354 * testsuite/23_containers/forward_list/debug/90102.cc: New test.
355 * testsuite/23_containers/list/debug/90102.cc: New test.
356 * testsuite/23_containers/map/debug/90102.cc: New test.
357 * testsuite/23_containers/multimap/debug/90102.cc: New test.
358 * testsuite/23_containers/multiset/debug/90102.cc: New test.
359 * testsuite/23_containers/set/debug/90102.cc: New test.
360 * testsuite/23_containers/unordered_map/debug/90102.cc: New test.
361 * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test.
362 * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test.
363 * testsuite/23_containers/unordered_set/debug/90102.cc: New test.
364 * testsuite/23_containers/vector/debug/90102.cc: New test.
366 2020-06-01 Jonathan Wakely <jwakely@redhat.com>
369 * include/bits/fs_path.h (path::_S_to_string): Move to
370 namespace-scope and rename to ...
371 (__detail::__string_from_range): ... this.
372 [WINDOWS] (__detail::__wstr_from_utf8): New function template to
373 convert a char sequence containing UTF-8 to wstring.
374 (path::_S_convert(Iter, Iter)): Adjust call to _S_to_string.
375 (path::_S_convert_loc(Iter, Iter, const locale&)): Likewise.
376 (u8path(InputIterator, InputIterator)) [WINDOWS]: Use
377 __string_from_range to obtain a contiguous range and
378 __wstr_from_utf8 to obtain a wide string.
379 (u8path(const Source&)) [WINDOWS]: Use __effective_range to
380 obtain a contiguous range and __wstr_from_utf8 to obtain a wide
382 (path::_S_convert(const _EcharT*, const _EcharT)) [WINDOWS]:
383 Use __wstr_from_utf8.
385 2020-06-01 Jonathan Wakely <jwakely@redhat.com>
387 * testsuite/util/testsuite_iterators.h:
388 (input_iterator_wrapper::operator++(int)): Return proxy object.
390 2020-06-01 Jonathan Wakely <jwakely@redhat.com>
392 * doc/xml/manual/evolution.xml: Document deprecation of
393 __is_nullptr_t and removal of std::allocator members.
394 * doc/html/manual/api.html: Regenerate.
396 2020-06-01 Jonathan Wakely <jwakely@redhat.com>
398 * doc/xml/manual/containers.xml: Replace <xref> with <link>.
399 * doc/xml/manual/evolution.xml: Likewise.
400 * doc/html/manual/api.html: Regenerate.
401 * doc/html/manual/containers.html: Regenerate.
403 2020-06-01 Gerald Pfeifer <gerald@pfeifer.com>
405 * doc/xml/faq.xml: Adjust Valgrind reference and remove another.
406 * doc/html/faq.html: Regenerate.
408 2020-06-01 Gerald Pfeifer <gerald@pfeifer.com>
410 * doc/xml/manual/policy_data_structures_biblio.xml: Remove
413 2020-06-01 Gerald Pfeifer <gerald@pfeifer.com>
415 * doc/xml/manual/policy_data_structures_biblio.xml: Switch
416 www.cs.princeton.edu to https.
417 * doc/html/manual/policy_data_structures.html: Regenerate.
419 2020-05-31 Douglas B Rupp <douglas.b.rupp@gmail.com>
421 * crossconfig.m4 (<*-vxworks>): Check for more math decls.
422 * configure: Rebuild.
424 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
427 * configure: Regenerated.
429 2020-05-29 François Dumont <fdumont@gcc.gnu.org>
432 * include/bits/hashtable_policy.h (_Insert_base<>::try_emplace): New.
433 * include/bits/unordered_map.h (unordered_map<>::try_emplace): Adapt.
434 (unordered_map<>::insert_or_assign): Adapt.
436 2020-05-27 Jonathan Wakely <jwakely@redhat.com>
439 * include/bits/atomic_base.h (__atomic_impl::load): Add
440 cv-qualifiers to parameter so that _Tp is deduced as the
442 * testsuite/29_atomics/atomic_float/95282.cc: New test.
444 2020-05-27 Jonathan Wakely <jwakely@redhat.com>
447 * include/std/ranges (transform_view::_Sentinel): Allow hidden
448 friends to work with _Iterator<true> and _Iterator<false>.
449 (join_view::_Sentinel): Likewise.
450 * testsuite/std/ranges/adaptors/95322.cc: New test.
452 2020-05-27 Jonathan Wakely <jwakely@redhat.com>
455 * include/bits/stl_iterator.h (reverse_iterator): Fix comparison
456 operators to use the correct operations on the underlying
458 * testsuite/24_iterators/reverse_iterator/rel_ops.cc: New test.
460 2020-05-27 Jonathan Wakely <jwakely@redhat.com>
462 * testsuite/18_support/comparisons/categories/zero_neg.cc: New test.
464 2020-05-26 Patrick Palka <ppalka@redhat.com>
467 * include/bits/stl_iterator.h (__detail::_Common_iter_proxy):
468 Remove and instead define it ...
469 (common_iterator::_Proxy): ... here.
470 (common_iterator::operator->): Use it.
471 * testsuite/24_iterators/common_iterator/2.cc: New test.
472 * testsuite/std/ranges/adaptors/95322.cc: New test.
474 2020-05-23 Patrick Palka <ppalka@redhat.com>
477 * testsuite/std/ranges/adaptors/93978.cc: Add -Wall to
478 dg-additional-options. Avoid unused-but-set-variable warning.
480 2020-05-23 Jonathan Wakely <jwakely@redhat.com>
483 * include/debug/helper_functions.h (__get_distance): Only declare
484 as a constexpr function for C++14 and up.
485 * testsuite/25_algorithms/copy/debug/95289.cc: New test.
487 * include/bits/fs_path.h (__detail::_S_range_begin)
488 (__detail::_S_range_end, path::_S_string_from_iter): Replace with
489 overloaded function template __detail::__effective_range.
490 (__detail::__effective_range): New overloaded function template to
491 create a basic_string or basic_string_view for an effective range.
492 (__detail::__value_type_is_char): Use __detail::__effective_range.
493 Do not use remove_const on value type.
494 (__detail::__value_type_is_char_or_char8_t): Likewise.
495 (path::path(const Source&, format))
496 (path::path(const Source&, const locale&))
497 (path::operator/=(const Source&), path::append(const Source&))
498 (path::concat(const Source&)): Use __detail::__effective_range.
499 (path::_S_to_string(InputIterator, InputIterator)): New function
500 template to create a string view if possible, or string otherwise.
501 (path::_S_convert): Add overloads that convert a string returned
502 by __detail::__effective_range. Use if-constexpr to inline conversion
503 logic from all overloads of _Cvt::_S_convert.
504 (path::_S_convert_loc): Add overload that converts a string. Use
505 _S_to_string to avoid allocation when possible.
506 (path::_Cvt): Remove.
507 (path::operator+=(CharT)): Remove indirection through path::concat.
508 * include/experimental/bits/fs_path.h (path::_S_convert_loc): Add
509 overload for non-const pointers, to avoid constructing a std::string.
510 * src/c++17/fs_path.cc (path::_S_convert_loc): Replace conditional
511 compilation with call to _S_convert.
513 * include/bits/fs_path.h (__detail::_S_range_begin)
514 (__detail::_S_range_end): Remove unintentional static specifiers.
515 * include/experimental/bits/fs_path.h (__detail::_S_range_begin)
516 (__detail::_S_range_end): Likewise.
518 * include/bits/fs_path.h (filesystem::__detail::__is_encoded_char):
519 Replace alias template with variable template. Don't remove const.
520 (filesystem::__detail::__is_path_src): Replace overloaded function
521 template with variable template and specializations.
522 (filesystem::__detail::__is_path_iter_src): Replace alias template
524 (filesystem::__detail::_Path): Use __is_path_src. Remove support for
526 (filesystem::__detail::_Path2): New alias template for checking
527 InputIterator requirements.
528 (filesystem::__detail::__constructible_from): Remove.
529 (filesystem::path): Replace _Path<Iter, Iter> with _Path2<Iter>.
530 * testsuite/27_io/filesystem/path/construct/80762.cc: Check with two
531 constructor arguments of void and void* types.
533 2020-05-21 Matthias Kretz <kretz@kde.org>
535 * testsuite/Makefile.am: Remove dup target_triplet and set tool,
536 allowing runtest to work without arguments.
537 * testsuite/Makefile.in: Regenerate.
539 2020-05-21 Jonathan Wakely <jwakely@redhat.com>
542 * include/bits/iterator_concepts.h (__detail::__cpp17_iterator):
543 Reorder constraints to avoid recursion when constructors use
544 iterator_traits (LWG 3420).
545 * testsuite/24_iterators/customization_points/lwg3420.cc: New test.
547 * include/experimental/socket (basic_socket::is_open()
548 (basic_socket_acceptor::is_open()): Use _GLIBCXX_NODISCARD macro.
550 * include/experimental/bits/net.h (__endpoint, __protocol)
551 (__acceptable_protocol, __inet_protocol): New concepts.
552 (__detail::__is_endpoint): Move trait from <experimental/socket>.
553 (__is_protocol, __is_acceptable_protocol, __is_inet_protocol): New
555 (__endpoint, __protocol, __acceptable_protocol): New variable
557 * include/experimental/socket (__is_endpoint): Move to net.h header.
558 (basic_socket, basic_socket_acceptor): Check requirements.
560 * include/experimental/executor (use_future_t::use_future_t()): Fix
561 incorrect noexcept-specifier.
562 * include/experimental/internet (basic_resolver_results): Adjust
564 * include/experimental/socket (__basic_socket_impl::release): Add
566 (basic_socket(io_context&, const endpoint_type&)): Fix argument to
568 (basic_socket::release(), basic_socket::release(error_code&)): Add
569 missing member functions.
570 (basic_socket::is_open()): Add nodiscard attribute.
571 (basic_socket::close(error_code&)): Pass argument to base function.
572 (basic_socket_acceptor::release())
573 (basic_socket_acceptor::release(error_code&)): Add missing member
575 (basic_socket_acceptor::is_open()): Add nodiscard attribute.
576 (basic_socket_streambuf::error()): Add noexcept.
577 (basic_socket_iostream::error()): Likewise.
578 * testsuite/experimental/net/socket/basic_socket.cc: New test.
580 * include/experimental/buffer: Replace typedefs with
582 * include/experimental/executor: Likewise.
583 * include/experimental/internet: Likewise.
584 * include/experimental/socket: Likewise.
585 * include/experimental/timer: Likewise.
587 2020-05-19 Jonathan Wakely <jwakely@redhat.com>
590 * src/c++11/random.cc (__x86_rdseed): Allow fallback function to be
592 (__x86_rdseed_rdrand): New function that uses rdseed with rdrand
594 (random_device::_M_init): Use __x86_rdseed_rdrand when both
595 instructions are available.
596 * testsuite/26_numerics/random/random_device/94087.cc: New test.
598 2020-05-19 Patrick Palka <ppalka@redhat.com>
601 * testsuite/20_util/pair/astuple/get_neg.cc: Prune "type/value
603 * testsuite/20_util/tuple/element_access/get_neg.cc: Likewise.
605 2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
608 * configure: Regenerated.
610 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
612 * configure: Regenerated.
614 2020-05-13 Alexandre Oliva <oliva@adacore.com>
617 * include/experimental/memory_resource
618 (__resource_adaptor_imp::do_allocate): Handle max_align_t on
619 x86-vxworks as on x86-solaris.
620 (__resource_adaptor_imp::do_deallocate): Likewise.
621 * testsuite/experimental/memory_resource/new_delete_resource.cc:
623 (BAD_MAX_ALIGN_T): Define on x86-vxworks as on x86-solaris.
624 (test03): Drop max-align test for char-aligned alloc.
626 2020-05-08 Ulrich Drepper <drepper@redhat.com>
628 * include/bits/atomic_base.h (atomic_flag): Implement test member
630 * include/std/version: Define __cpp_lib_atomic_flag_test.
631 * testsuite/29_atomics/atomic_flag/test/explicit.cc: New file.
632 * testsuite/29_atomics/atomic_flag/test/implicit.cc: New file.
634 2020-05-07 Jonathan Wakely <jwakely@redhat.com>
636 PR libstdc++/94971 (partial)
637 * include/bits/ranges_algo.h (ranges::__sample_fn): Qualify
638 std::sample using macro to work in parallel mode.
639 (__sort_fn): Likewise for std::sort.
640 (ranges::__nth_element_fn): Likewise for std::nth_element.
641 * include/bits/stl_algobase.h (lexicographical_compare_three_way):
642 Likewise for std::__min_cmp.
643 * include/parallel/algobase.h (lexicographical_compare_three_way):
644 Add to namespace std::__parallel.
647 * include/parallel/multiway_merge.h (_GuardedIterator::operator*)
648 (_GuardedIterator::operator _RAIter, _UnguardedIterator::operator*)
649 (_UnguardedIterator::operator _RAIter): Add const qualifier.
650 (operator<(_GuardedIterator&, _GuardedIterator&)
651 (operator<=(_GuardedIterator&, _GuardedIterator&)
652 (operator<(_UnguardedIterator&, _UnguardedIterator&)
653 (operator<=(_UnguardedIterator&, _UnguardedIterator&): Change
654 parameters to const references.
656 2020-05-07 Eric Botcazou <ebotcazou@adacore.com>
658 * config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: Update.
659 * config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: Likewise.
661 2020-05-06 François Dumont <fdumont@gcc.gnu.org>
663 * include/bits/stl_algobase.h (struct _Bit_iterator): New declaration.
664 (std::__fill_a1(_Bit_iterator, _Bit_iterator, const bool&)): Likewise.
665 * include/bits/stl_bvector.h (__fill_bvector): Move outside
666 _GLIBCXX_STD_C namespace.
667 (fill(_Bit_iterator, _Bit_iterator, const bool&)): Likewise and rename
669 (__fill_a1): ...this.
670 * testsuite/25_algorithms/fill/bvector/1.cc: New.
672 2020-05-06 H.J. Lu <hongjiu.lu@intel.com>
674 * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
676 2020-05-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
678 * config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
679 * config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
681 * config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
682 * config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
685 2020-05-06 Martin Liska <mliska@suse.cz>
688 2020-05-05 Martin Liska <mliska@suse.cz>
690 * include/parallel/multiway_merge.h:
691 Use const for _Compare template argument.
693 2020-05-06 Jonathan Wakely <jwakely@redhat.com>
695 * doc/xml/manual/abi.xml (abi.versioning.history): Document library
696 versions for GCC 9.[123] and 10.1 releases.
697 * doc/html/*: Regenerate.
699 2020-05-06 Jakub Jelinek <jakub@redhat.com>
701 * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
702 * config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
703 * config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
704 * config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
705 * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
706 * config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.
707 * config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
709 2020-05-05 Martin Liska <mliska@suse.cz>
712 * include/parallel/multiway_merge.h:
713 Use const for _Compare template argument.
715 2020-05-04 Fangrui Song <maskray@google.com>
717 * libsupc++/cxxabi.h (__cxa_finalize): Fix return type.
719 2020-05-04 Jonathan Wakely <jwakely@redhat.com>
721 * doc/xml/faq.xml: Use working link for SGI STL FAQ.
722 * doc/html/*: Regenerate.
725 * src/c++17/memory_resource.cc
726 (monotonic_buffer_resource::_Chunk::release): Use size_t for shift
729 2020-05-04 Nathan Sidwell <nathan@acm.org>
732 * libsupc++/dyncast.cc (__dynamic_cast): Cast offsetof to
733 ptrdiff_t before negation, to show intent more clearly.
735 2020-05-04 Jonathan Wakely <jwakely@redhat.com>
738 * src/c++17/memory_resource.cc (synchronized_pool_resource::_TPools):
739 Add comment about single-threaded behaviour.
740 (synchronized_pool_resource::_TPools::move_nonempty_chunks()): Hoist
741 class member access out of loop.
742 (synchronized_pool_resource::synchronized_pool_resource())
743 (synchronized_pool_resource::~synchronized_pool_resource())
744 (synchronized_pool_resource::release()): Check __gthread_active_p
745 before creating and/or deleting the thread-specific data key.
746 (synchronized_pool_resource::_M_thread_specific_pools()): Adjust
748 (synchronized_pool_resource::do_allocate(size_t, size_t)): Add fast
749 path for single-threaded case.
750 (synchronized_pool_resource::do_deallocate(void*, size_t, size_t)):
751 Likewise. Return if unable to find a pool that owns the allocation.
752 * testsuite/20_util/synchronized_pool_resource/allocate_single.cc:
754 * testsuite/20_util/synchronized_pool_resource/cons_single.cc: New
756 * testsuite/20_util/synchronized_pool_resource/release_single.cc: New
759 2020-05-03 Jonathan Wakely <jwakely@redhat.com>
762 * include/bits/stl_algobase.h (__fill_a1): Make overload for byte types
763 usable in constant expressions.
764 * testsuite/25_algorithms/fill_n/constexpr.cc: Test with bytes and
767 2020-05-01 Jonathan Wakely <jwakely@redhat.com>
770 * testsuite/17_intro/badnames.cc: Test values between _E9 and _E24 too.
772 2020-05-01 Jonathan Wakely <jwakely@redhat.com>
773 Patrick Palka <ppalka@redhat.com>
776 * include/bits/iterator_concepts.h (ranges::__cust_imove::_IMove):
777 Add trait to determine return type and an alias for it.
778 (ranges::__cust_imove::_IMove::operator()): Use __result instead of
780 (iter_rvalue_reference_t): Use _IMove::__type instead of checking
781 the result of ranges::iter_move.
782 (__detail::__indirectly_readable_impl): Use iter_rvalue_reference_t
783 instead of checking the result of ranges::iter_move.
784 * testsuite/24_iterators/customization_points/92894.cc: New test.
785 * testsuite/24_iterators/indirect_callable/92894.cc: New test.
787 2020-05-01 Jonathan Wakely <jwakely@redhat.com>
790 * include/std/type_traits (__is_complete_or_unbounded): Replace
792 * testsuite/17_intro/badnames.cc: New test.
794 2020-04-30 Jonathan Wakely <jwakely@redhat.com>
797 * include/bits/alloc_traits.h (allocator_traits::_S_construct)
798 (allocator_traits::_S_destroy)
799 (allocator_traits<allocator<T>>::construct): Use traits in
801 * include/bits/allocator.h (allocator<void>::construct)
802 (allocator<void>::destroy): Likewise.
803 * include/ext/malloc_allocator.h (malloc_allocator::construct)
804 (malloc_allocator::destroy): Likewise.
805 * include/ext/new_allocator.h (new_allocator::construct)
806 (new_allocator::destroy): Likewise.
807 * testsuite/20_util/allocator/89510.cc: New test.
808 * testsuite/ext/malloc_allocator/89510.cc: New test.
809 * testsuite/ext/new_allocator/89510.cc: New test.
811 2020-04-29 Jonathan Wakely <jwakely@redhat.com>
814 * include/bits/basic_string.tcc: Update comment about explicit
817 2020-04-28 Jonathan Wakely <jwakely@redhat.com>
820 * include/bits/allocator.h (__cpp_lib_allocator_is_always_equal):
821 Remove non-standard macro.
822 * include/bits/stl_iterator.h (__cpp_lib_constexpr_iterator): Define
823 to indicate P1032R1 support.
824 * include/bits/stl_pair.h (__cpp_lib_constexpr_utility): Likewise.
825 * include/std/string_view (__cpp_lib_constexpr_string_view): Likewise.
826 * include/std/tuple (__cpp_lib_constexpr_tuple): Likewise.
827 * include/std/version (__cpp_lib_allocator_is_always_equal): Remove.
828 (__cpp_lib_constexpr_iterator, __cpp_lib_constexpr_string_view)
829 (__cpp_lib_constexpr_tuple, __cpp_lib_constexpr_utility): Define.
830 * testsuite/20_util/function_objects/constexpr_searcher.cc: Check
832 * testsuite/20_util/tuple/cons/constexpr_allocator_arg_t.cc: Likewise.
833 * testsuite/21_strings/basic_string_view/operations/copy/char/
834 constexpr.cc: Likewise.
835 * testsuite/24_iterators/insert_iterator/constexpr.cc: Likewise.
838 * include/bits/alloc_traits.h (_S_construct): Restore placement
839 new-expression for C++11/14/17 and call std::construct_at directly
841 * include/bits/stl_construct.h (_Construct): Revert to non-constexpr
842 function returning void.
843 * testsuite/20_util/specialized_algorithms/
844 uninitialized_value_construct/94831.cc: New test.
845 * testsuite/23_containers/vector/cons/94831.cc: New test.
847 2020-04-28 Patrick Palka <ppalka@redhat.com>
849 LWG 3433 subrange::advance(n) has UB when n < 0
850 * include/std/ranges (subrange::prev): Fix typo.
851 (subrange::advance): Handle a negative argument as per the proposed
852 resolution of LWG 3433.
853 * testsuite/std/ranges/subrange/lwg3433.cc: New test.
855 2020-04-28 Jonathan Wakely <jwakely@redhat.com>
856 Iain Sandoe <iain@sandoe.co.uk>
859 * include/std/coroutine: Implement handing for non-
860 class coroutine return types.
862 2020-04-24 Jonathan Wakely <jwakely@redhat.com>
864 * include/experimental/executor (service_already_exists): Make default
865 constructor public (LWG 3414).
866 * testsuite/experimental/net/execution_context/make_service.cc: Check
867 the service_already_exists can be default constructed.
869 2020-04-24 Kamlesh Kumar <kamleshbhalui@gmail.com>
870 Jonathan Wakely <jwakely@redhat.com>
874 * include/std/any (any): Rename template parameters for consistency
876 (any::_Decay): Rename to _Decay_if_not_any.
877 (any::any(T&&):: Remove is_constructible from constraints. Remove
878 non-standard overload.
879 (any::any(in_place_type_t<T>, Args&&...))
880 (any::any(in_place_type_t<T>, initializer_list<U>, Args&&...))
881 (any::emplace(Args&&...))
882 (any::emplace(initializer_list<U>, Args&&...)):
883 Use decay_t instead of _Decay.
884 * testsuite/20_util/any/cons/90415.cc: New test.
885 * testsuite/20_util/any/cons/92156.cc: New Test.
886 * testsuite/20_util/any/misc/any_cast_neg.cc: Make dg-error directives
888 * testsuite/20_util/any/modifiers/92156.cc: New test.
890 2020-04-23 Jonathan Wakely <jwakely@redhat.com>
892 * doc/xml/manual/status_cxx2020.xml: Update C++20 status table.
893 * doc/html/*: Regenerate.
895 * include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Revert
896 value for C++17 to 201803L because P0858R0 is supported for C++17.
897 * include/std/version (__cpp_lib_array_constexpr): Likewise.
898 * testsuite/23_containers/array/element_access/constexpr_c++17.cc:
899 Check for value corresponding to P0031R0 features being tested.
900 * testsuite/23_containers/array/requirements/constexpr_iter.cc:
901 Check for value corresponding to P0858R0 features being tested.
903 * include/std/version (__cpp_lib_three_way_comparison): Define for
906 2020-04-23 Thomas Rodgers <rodgert@appliantology.com>
908 * include/experimental/net/executor (system_context): Mark
909 system_context::system_context() = delete.
910 * testsuite/experimental/net/executor/1.cc: Add new
911 test to check system_context is not default constructible.
913 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
915 * include/std/coroutine: Update the inline namespace to __n4861.
916 Add the __cpp_lib_coroutine define, set to 201902L.
917 * include/std/version: Add __cpp_lib_coroutine, set to 201902L.
919 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
921 * include/std/execution (__cpp_lib_execution): Define to indicate
922 support for P0024R2 and P1001R2.
923 * include/std/version (__cpp_lib_execution): Define.
924 * testsuite/25_algorithms/pstl/feature_test.cc: Only test macro
925 defined by <algorithm>, move other tests to new tests ...
926 * testsuite/25_algorithms/pstl/feature_test-2.cc: New test.
927 * testsuite/25_algorithms/pstl/feature_test-3.cc: New test.
928 * testsuite/25_algorithms/pstl/feature_test-4.cc: New test.
929 * testsuite/25_algorithms/pstl/feature_test-5.cc: New test.
931 * include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Define
932 different values for C++17 and C++20, to indicate different feature
933 sets. Update value for C++20 to indicate P1032R1 support.
934 * include/std/version (__cpp_lib_array_constexpr): Likewise.
935 * testsuite/23_containers/array/comparison_operators/constexpr.cc:
936 Check feature test macro.
937 * testsuite/23_containers/array/element_access/constexpr_c++17.cc:
939 * testsuite/23_containers/array/requirements/constexpr_fill.cc: Check
941 * testsuite/23_containers/array/requirements/constexpr_iter.cc: Test
942 in C++17 mode and check feature test macro.
944 * include/std/utility (__cpp_lib_constexpr_algorithms): Do not define
946 * testsuite/20_util/exchange/constexpr.cc: Do not expect macro to be
947 defined by <utility>.
949 * include/std/functional (__cpp_lib_concepts): Update macro value to
950 indicate P1964R2 support.
951 * include/std/version (__cpp_lib_concepts): Likewise.
952 * testsuite/std/concepts/1.cc: Adjust expected value.
953 * testsuite/std/concepts/2.cc: Likewise.
955 * include/std/functional (__cpp_lib_constexpr_invoke): Rename to
956 __cpp_lib_constexpr_functional.
957 * include/std/version (__cpp_lib_constexpr_invoke): Likewise.
958 * testsuite/20_util/function_objects/invoke/constexpr.cc: Adjust.
960 * include/bits/ptr_traits.h (__cpp_lib_constexpr_memory): Define to
961 indicate P1006R1 support.
962 (__cpp_lib_to_address): Define to indicate P0653R2 support.
963 * include/bits/range_access.h (__cpp_lib_ssize): Define to indicate
965 * include/bits/ranges_algo.h (__cpp_lib_shift): Define to indicate
967 * include/std/atomic (__cpp_lib_atomic_float): Define to indicate
969 * include/std/memory (__cpp_lib_assume_aligned): Define to indicate
971 * include/std/memory_resource (__cpp_lib_polymorphic_allocator):
972 Define to indicate P0339R6 support.
973 * include/std/string_view (__cpp_lib_starts_ends_with): Define to
974 indicate P0457R2 support.
975 * include/std/type_traits (__cpp_lib_is_nothrow_convertible): Define
976 to indicate P0758R1 support.
977 (__cpp_lib_remove_cvref): Define to indicate P0550R2 support.
978 (__cpp_lib_type_identity): Define to indicate P0887R1 support.
979 * include/std/version (__cpp_lib_atomic_float)
980 (__cpp_lib_is_nothrow_convertible, __cpp_lib_remove_cvref)
981 (__cpp_lib_type_identity, __cpp_lib_assume_aligned)
982 (__cpp_lib_constexpr_memory, __cpp_lib_polymorphic_allocator)
983 (__cpp_lib_shift, __cpp_lib_ssize, __cpp_lib_starts_ends_with)
984 (__cpp_lib_to_address): Define.
985 * testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number.
987 * include/bits/stl_map.h (__cpp_lib_map_insertion): Remove old
989 * include/bits/unordered_map.h (__cpp_lib_unordered_map_insertion):
991 * include/std/version (__cpp_lib_map_insertion)
992 (__cpp_lib_unordered_map_insertion): Remove.
994 * include/std/condition_variable (__cpp_lib_jthread): Remove
995 redundant definition.
996 * include/std/stop_token (__cpp_lib_jthread): Update macro value to
997 indicate P1869R1 support.
998 * include/std/version (__cpp_lib_jthread): Update value.
999 * testsuite/30_threads/condition_variable_any/stop_token/1.cc: Check
1000 for updated macro value.
1001 * testsuite/30_threads/condition_variable_any/stop_token/2.cc:
1003 * testsuite/30_threads/jthread/1.cc: Likewise.
1004 * testsuite/30_threads/jthread/2.cc: Likewise.
1005 * testsuite/30_threads/stop_token/1.cc: Likewise.
1006 * testsuite/30_threads/stop_token/2.cc: Likewise.
1008 * testsuite/21_strings/basic_string/erasure.cc: Check for
1009 __cpp_lib_erase_if macro.
1010 * testsuite/23_containers/deque/erasure.cc: Add header name to #error
1012 * testsuite/23_containers/forward_list/erasure.cc: Likewise.
1013 * testsuite/23_containers/list/erasure.cc: Likewise.
1014 * testsuite/23_containers/map/erasure.cc: Likewise.
1015 * testsuite/23_containers/set/erasure.cc: Likewise.
1016 * testsuite/23_containers/unordered_map/erasure.cc: Likewise.
1017 * testsuite/23_containers/unordered_set/erasure.cc: Likewise.
1018 * testsuite/23_containers/vector/erasure.cc: Likewise.
1020 2020-04-21 Jonathan Wakely <jwakely@redhat.com>
1022 * include/bits/stl_iterator.h (__normal_iterator): Use synth-three-way
1023 to define operator<=>.
1024 * testsuite/24_iterators/normal_iterator/cmp_c++20.cc: New test.
1026 * doc/Makefile.am (xml_sources_manual): Add missing XML files.
1027 * doc/Makefile.in: Regenerate.
1028 * doc/xml/manual/status_cxx1998.xml: Refer to "this section" instead
1030 * doc/xml/manual/status_cxx2011.xml: Formatting and other corrections
1031 to the C++11 status table.
1032 * doc/xml/manual/status_cxx2014.xml: Replace list of C++14 feature
1033 proposals with table matching contents of the C++14 standard.
1034 * doc/xml/manual/status_cxx2017.xml: Add table matching contents of
1036 * doc/html/*: Regenerate.
1039 * include/std/type_traits (__is_nt_constructible_impl): Add partial
1040 specializations for bounded arrays with non-empty initializers.
1041 * testsuite/20_util/is_nothrow_constructible/value_c++20.cc: New test.
1043 2020-04-20 Thomas Rodgers <trodgers@redhat.com>
1045 * testsuite/lib/libstdc++.exp: Add additional_flags=
1046 -DTBB_SUPRESS_DEPRECATED_MESSAGES=1 to suppress warnings when
1047 compiling with a newer Thread Building Blocks.
1049 2020-04-20 Jonathan Wakely <jwakely@redhat.com>
1051 * testsuite/24_iterators/istreambuf_iterator/sentinel.cc: New test.
1053 * testsuite/20_util/is_constructible/51185.cc: Make test class a
1054 non-aggregate so that the test verifies the same thing in all -std
1056 * testsuite/20_util/is_constructible/value-2.cc: Adjust expected
1057 results for some types when paren-init for aggregates is supported.
1059 * include/std/version (__cpp_lib_three_way_comparison): Update value.
1060 * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise.
1061 (__detail::__synth3way): Add noexcept-specifier.
1063 * include/bits/stl_map.h (map): Define operator<=> and remove
1064 operator< for C++20.
1065 * include/bits/stl_multimap.h (multimap): Likewise.
1066 * include/bits/stl_multiset.h (multiset): Likewise.
1067 * include/bits/stl_set.h (set): Likewise.
1068 * include/bits/stl_tree.h (_Rb_tree): Likewise.
1069 (_Rb_tree_iterator, _Rb_tree_const_iterator): Remove redundant
1070 operator!= for C++20.
1071 * include/debug/map.h (__gnu_debug::map): Define operator<=> for C++20.
1072 * include/debug/multimap.h (__gnu_debug::multimap): Likewise.
1073 * include/debug/multiset.h (__gnu_debug::multiset): Likewise.
1074 * include/debug/set.h (__gnu_debug::set): Likewise.
1075 * testsuite/23_containers/map/operators/cmp_c++20.cc: New test.
1076 * testsuite/23_containers/multimap/operators/cmp_c++20.cc: New test.
1077 * testsuite/23_containers/multiset/operators/cmp_c++20.cc: New test.
1078 * testsuite/23_containers/set/operators/cmp_c++20.cc: New test.
1080 2020-04-20 Matthias Kretz <kretz@kde.org>
1082 * testsuite/lib/libstdc++.exp: Avoid illegal argument to verbose.
1084 2020-04-19 Jonathan Wakely <jwakely@redhat.com>
1086 * include/bits/stl_queue.h (queue): Define operator<=> for C++20.
1087 * include/bits/stl_stack.h (stack): Likewise.
1088 * testsuite/23_containers/queue/cmp_c++20.cc: New test.
1089 * testsuite/23_containers/stack/cmp_c++20.cc: New test.
1091 * include/bits/unordered_map.h (unordered_map, unordered_multimap):
1092 Remove redundant operator!= for C++20.
1093 * include/bits/unordered_set.h (unordered_set, unordered_multiset):
1095 * include/debug/unordered_map (unordered_map, unordered_multimap):
1097 * include/debug/unordered_set (unordered_set, unordered_multiset):
1101 * include/debug/formatter.h (_Error_formatter::_Parameter): Fix
1102 redundant assignment in constructor.
1104 2020-04-18 Jonathan Wakely <jwakely@redhat.com>
1106 * include/std/chrono (duration, time_point): Define operator<=> and
1107 remove redundant operator!= for C++20.
1108 * testsuite/20_util/duration/comparison_operators/three_way.cc: New
1110 * testsuite/20_util/time_point/comparison_operators/three_way.cc: New
1113 * testsuite/util/native_type/native_priority_queue.hpp: Use
1114 allocator_traits to rebind allocator.
1116 2020-04-17 Jonathan Wakely <jwakely@redhat.com>
1118 * include/bits/forward_list.h (forward_list): Define operator<=> and
1119 remove redundant comparison operators for C++20.
1120 * include/bits/stl_bvector.h (vector<bool, Alloc>): Likewise.
1121 * include/bits/stl_deque.h (deque): Likewise.
1122 * include/bits/stl_iterator.h (__normal_iterator): Likewise.
1123 * include/bits/stl_list.h (list): Likewise.
1124 * include/bits/stl_vector.h (vector): Likewise.
1125 * include/debug/deque (__gnu_debug::deque): Likewise.
1126 * include/debug/forward_list (__gnu_debug::forward_list): Likewise.
1127 * include/debug/list (__gnu_debug::list): Likewise.
1128 * include/debug/safe_iterator.h (__gnu_debug::_Safe_iterator):
1130 * include/debug/vector (__gnu_debug::vector): Likewise.
1131 * include/ext/pointer.h (__gnu_cxx::_Pointer_adapter): Define
1132 operator<=> for C++20.
1133 * testsuite/23_containers/deque/operators/cmp_c++20.cc: New test.
1134 * testsuite/23_containers/forward_list/cmp_c++20.cc: New test.
1135 * testsuite/23_containers/list/cmp_c++20.cc: New test.
1136 * testsuite/23_containers/vector/bool/cmp_c++20.cc: New test.
1137 * testsuite/23_containers/vector/cmp_c++20.cc: New test.
1139 * include/bits/basic_string.h (basic_string): Define operator<=> and
1140 remove redundant comparison operators for C++20.
1141 * include/bits/char_traits.h (__gnu_cxx::char_traits, char_traits):
1142 Add comparison_category members.
1143 (__detail::__char_traits_cmp_cat): New helper to get comparison
1144 category from char traits class.
1145 * include/bits/regex.h (regex_traits::_RegexMask::operator!=): Do not
1147 (sub_match): Define operator<=> and remove redundant comparison
1148 operators for C++20.
1149 (match_results): Remove redundant operator!= for C++20.
1150 * include/std/string_view (basic_string_view): Define operator<=> and
1151 remove redundant comparison operators for C++20.
1152 * testsuite/21_strings/basic_string/operators/char/cmp_c++20.cc: New
1154 * testsuite/21_strings/basic_string/operators/wchar_t/cmp_c++20.cc:
1156 * testsuite/21_strings/basic_string_view/operations/copy/char/
1157 constexpr.cc: Initialize variable.
1158 * testsuite/21_strings/basic_string_view/operations/copy/wchar_t/
1159 constexpr.cc: Likewise.
1160 * testsuite/21_strings/basic_string_view/operators/char/2.cc: Add
1161 dg-do directive and remove comments showing incorrect signatures.
1162 * testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
1164 * testsuite/21_strings/basic_string_view/operators/char/cmp_c++20.cc:
1166 * testsuite/21_strings/basic_string_view/operators/wchar_t/cmp_c++20.cc:
1168 * testsuite/28_regex/sub_match/compare_c++20.cc: New test.
1170 2020-04-16 Jonathan Wakely <jwakely@redhat.com>
1172 * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Remove
1173 name of unused parameter.
1175 2020-04-15 Jonathan Wakely <jwakely@redhat.com>
1177 * include/bits/fs_dir.h (file_status): Define operator== for C++20.
1178 (directory_entry): Define operator<=> and remove redundant comparison
1179 operators for C++20.
1180 * include/bits/fs_fwd.h (space_info): Define operator== for C++20.
1181 * include/bits/fs_path.h (path): Define operator<=> and remove
1182 redundant comparison operators for C++20.
1183 * testsuite/27_io/filesystem/path/compare/compare.cc: Fix comment.
1184 * testsuite/27_io/filesystem/path/compare/lwg2936.cc: Likewise.
1185 * testsuite/27_io/filesystem/path/compare/path.cc: Likewise.
1186 * testsuite/27_io/filesystem/path/compare/strings.cc: Likewise.
1188 * include/bits/allocator.h (operator!=): Do not define for C++20.
1189 * include/bits/locale_classes.h (operator!=): Likewise.
1190 * include/bits/std_function.h (operator==(nullptr_t, const function&))
1191 (operator!=(const function&, nullptr_t))
1192 (operator!=(nullptr_t, const function&)): Likewise.
1193 * include/ext/bitmap_allocator.h (operator!=): Likewise.
1194 * include/ext/debug_allocator.h (operator!=): Likewise.
1195 * include/ext/extptr_allocator.h (operator!=): Likewise.
1196 * include/ext/malloc_allocator.h (operator!=): Likewise.
1197 * include/ext/mt_allocator.h (operator!=): Likewise.
1198 * include/ext/new_allocator.h (operator!=): Likewise.
1199 * include/ext/pool_allocator.h (operator!=): Likewise.
1200 * include/ext/throw_allocator.h (operator!=): Likewise.
1201 * include/std/bitset (bitset::operator!=): Likewise.
1202 * include/std/memory_resource (operator!=): Likewise.
1203 * include/std/scoped_allocator (operator!=): Likewise.
1205 * include/std/typeindex (operator<=>): Define for C++20.
1206 * testsuite/20_util/typeindex/comparison_operators_c++20.cc: New test.
1208 2020-04-14 Jonathan Wakely <jwakely@redhat.com>
1210 * libsupc++/compare (compare_three_way): Fix constraint so that
1211 BUILTIN-PTR-THREE-WAY does not require three_way_comparable_with.
1212 * testsuite/18_support/comparisons/object/builtin-ptr-three-way.cc:
1216 * include/bits/shared_ptr.h (operator<=>): Define for C++20.
1217 * include/bits/shared_ptr_base.h (operator<=>): Likewise.
1218 * include/bits/unique_ptr.h (operator<=>): Add inline specifier.
1219 * testsuite/20_util/shared_ptr/comparison/cmp_c++20.cc: New test.
1220 * testsuite/20_util/shared_ptr/comparison/less.cc: Do not expect
1221 std::less<A*> to be used when comparing std::shared_ptr<A> objects in
1225 * libsupc++/compare (__unspec): Add noexcept-specifier to constructor.
1226 * testsuite/18_support/comparisons/categories/94565.cc: New test.
1228 2020-04-13 Iain Sandoe <iain@sandoe.co.uk>
1230 * include/std/coroutine: Update coroutines builtin define,
1233 2020-04-09 Jonathan Wakely <jwakely@redhat.com>
1235 * libsupc++/compare (compare_three_way): Fix noexcept-specifier.
1236 (strong_order, weak_order, partial_order): Replace uses of <=> with
1237 compare_three_way function object (LWG 3324).
1238 * testsuite/18_support/comparisons/algorithms/partial_order.cc: Add
1239 equality operator so that X satisfies three_way_comparable.
1240 * testsuite/18_support/comparisons/algorithms/strong_order.cc:
1242 * testsuite/18_support/comparisons/algorithms/weak_order.cc: Likewise.
1244 * include/bits/unique_ptr.h (operator<=>): Define for C++20.
1245 * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line.
1246 * testsuite/20_util/default_delete/void_neg.cc: Likewise.
1247 * testsuite/20_util/unique_ptr/comparison/compare.cc: New test.
1248 * testsuite/20_util/unique_ptr/comparison/compare_c++20.cc: New test.
1250 2020-04-08 Jonathan Wakely <jwakely@redhat.com>
1252 * include/bits/slice_array.h (operator==(const slice&, const slice&)):
1254 * include/std/complex (operator==(const T&, const complex<T>&))
1255 (operator!=(const complex<T>&, const complex<T>&))
1256 (operator!=(const complex<T>&, const T&))
1257 (operator!=(const T&, const complex<T>&)): Do not declare for C++20.
1258 * testsuite/26_numerics/slice/compare.cc: New test.
1260 * include/std/charconv (to_chars_result, from_chars_result): Add
1261 defaulted equality comparisons for C++20.
1262 * testsuite/20_util/from_chars/compare.cc: New test.
1263 * testsuite/20_util/to_chars/compare.cc: New test.
1265 2020-04-07 Jonathan Wakely <jwakely@redhat.com>
1268 * include/std/charconv (__integer_to_chars_result_type)
1269 (__integer_from_chars_result_type): Use __or_ instead of __or_v_ to
1271 * testsuite/20_util/from_chars/1.cc: Run test as C++14 and replace
1272 use of std::string_view with std::string.
1273 * testsuite/20_util/from_chars/2.cc: Likewise.
1274 * testsuite/20_util/to_chars/1.cc: Likewise.
1275 * testsuite/20_util/to_chars/2.cc: Likewise.
1277 2020-04-06 Jonathan Wakely <jwakely@redhat.com>
1280 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Make it
1281 usable in constant expressions for C++20.
1282 (__gnu_cxx::char_traits::copy, __gnu_cxx::char_traits::assign): Add
1283 _GLIBCXX20_CONSTEXPR.
1284 (std::char_traits<char>, std::char_traits<wchar_t>)
1285 (std::char_traits<char8_t>): Make move, copy and assign usable in
1286 constant expressions for C++20.
1287 (std::char_traits<char16_t>, std::char_traits<char32_t>): Make move
1288 and copy usable in constant expressions for C++20.
1289 * include/std/string_view (basic_string_view::copy): Add
1290 _GLIBCXX20_CONSTEXPR.
1291 * testsuite/21_strings/basic_string_view/operations/copy/char/
1292 constexpr.cc: New test.
1293 * testsuite/21_strings/basic_string_view/operations/copy/wchar_t/
1294 constexpr.cc: New test.
1296 2020-04-05 Gerald Pfeifer <gerald@pfeifer.com>
1298 * doc/xml/manual/appendix_contributing.xml: Refer to Git
1299 documentation instead of Subversion. Switch to https.
1300 * doc/html/manual/appendix_contributing.html: Regenerate.
1302 2020-04-03 Jonathan Wakely <jwakely@redhat.com>
1305 * include/bits/ptr_traits.h (__to_address): Add special case for debug
1306 iterators, to avoid dereferenceable check.
1307 * testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number.
1308 * testsuite/20_util/to_address/debug.cc: New test.
1310 2020-04-01 Andrea Corallo <andrea.corallo@arm.com>
1312 * testsuite/experimental/net/execution_context/use_service.cc:
1313 Require pthread and gthreads.
1315 2020-04-01 Gerald Pfeifer <gerald@pfeifer.com>
1317 * doc/xml/manual/appendix_free.xml: Move "free books" list from
1319 * doc/html/manual/appendix_free.html: Regenerate.
1321 2020-03-31 Ville Voutilainen <ville.voutilainen@gmail.com>
1323 Library-side tests for parenthesized aggregate init
1328 * testsuite/20_util/allocator_traits/members/92878_92947.cc: New.
1329 * testsuite/20_util/any/assign/92878_92947.cc: Likewise.
1330 * testsuite/20_util/any/cons/92878_92947.cc: Likewise.
1331 * testsuite/20_util/is_constructible/92878_92947.cc: Likewise.
1332 * testsuite/20_util/optional/assignment/92878_92947.cc: Likewise.
1333 * testsuite/20_util/optional/cons/92878_92947.cc: Likewise.
1334 * testsuite/20_util/pair/cons/92878_92947.cc: Likewise.
1335 * testsuite/20_util/shared_ptr/creation/92878_92947.cc: Likewise.
1336 * testsuite/20_util/specialized_algorithms/construct_at/92878_92947.cc:
1338 * testsuite/20_util/unique_ptr/creation/92878_92947.cc: Likewise.
1339 * testsuite/20_util/uses_allocator/92878_92947.cc: Likewise.
1340 * testsuite/20_util/variant/92878_92947.cc: Likewise.
1341 * testsuite/23_containers/deque/modifiers/emplace/92878_92947.cc:
1343 * testsuite/23_containers/forward_list/modifiers/92878_92947.cc:
1345 * testsuite/23_containers/list/modifiers/emplace/92878_92947.cc:
1347 * testsuite/23_containers/map/modifiers/emplace/92878_92947.cc:
1349 * testsuite/23_containers/multimap/modifiers/emplace/92878_92947.cc:
1351 * testsuite/23_containers/multiset/modifiers/emplace/92878_92947.cc:
1353 * testsuite/23_containers/priority_queue/92878_92947.cc: Likewise.
1354 * testsuite/23_containers/queue/92878_92947.cc: Likewise.
1355 * testsuite/23_containers/set/modifiers/emplace/92878_92947.cc:
1357 * testsuite/23_containers/stack/92878_92947.cc: Likewise.
1358 * testsuite/23_containers/unordered_map/modifiers/92878_92947.cc:
1360 * testsuite/23_containers/unordered_multimap/modifiers/92878_92947.cc:
1362 * testsuite/23_containers/unordered_multiset/modifiers/92878_92947.cc:
1364 * testsuite/23_containers/unordered_set/modifiers/92878_92947.cc:
1366 * testsuite/23_containers/vector/modifiers/emplace/92878_92947.cc:
1369 2020-03-28 Jonathan Wakely <jwakely@redhat.com>
1371 * testsuite/20_util/is_constructible/value-2.cc: Fix test to account
1372 for changes due to parenthesized aggregate-initialization in C++20.
1373 * testsuite/20_util/time_point/cons/81468.cc: Fix test to not clash
1374 with std::chrono::sys_time in C++20.
1376 * include/bits/stl_iterator.h (reverse_iterator): Use requires-clause
1377 to constrain C++20 versions of comparison operators. Fix backwards
1378 logic of relational operators.
1379 (move_iterator): Use requires-clause to constrain comparison operators
1380 in C++20. Do not declare non-standard same-type overloads for C++20.
1381 * testsuite/24_iterators/move_iterator/rel_ops_c++20.cc: Check result
1382 of comparisons and check using greedy_ops type.
1383 * testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc: Likewise.
1384 * testsuite/24_iterators/move_iterator/greedy_ops.cc: Remove redundant
1385 main function from compile-only test.
1386 * testsuite/24_iterators/reverse_iterator/greedy_ops.cc: Likewise.
1388 2020-03-27 Jonathan Wakely <jwakely@redhat.com>
1390 * include/bits/range_cmp.h (__cpp_lib_ranges): Define.
1391 * include/bits/stl_iterator.h: Check value of __cpp_concepts so that
1392 C++20 concepts are required.
1393 * include/bits/stl_iterator_base_types.h: Likewise.
1394 * include/std/concepts: Likewise.
1395 * include/std/version: Likewise.
1396 * testsuite/std/ranges/headers/ranges/synopsis.cc: Check feature test
1399 * include/bits/stl_iterator.h (reverse_iterator::iterator_concept)
1400 (reverse_iterator::iterator_category): Define for C++20.
1401 (reverse_iterator): Define comparison operators correctly for C++20.
1402 (__normal_iterator): Add constraints to comparison operators for C++20.
1403 (move_iterator::operator++(int)) [__cpp_lib_concepts]: Define new
1404 overload for input iterators.
1405 (move_iterator): Add constraints to comparison operators for C++20.
1406 Define operator<=> for C++20.
1407 * testsuite/24_iterators/move_iterator/input_iterator.cc: New test.
1408 * testsuite/24_iterators/move_iterator/move_only.cc: New test.
1409 * testsuite/24_iterators/move_iterator/rel_ops_c++20.cc: New test.
1410 * testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc: New test.
1412 * include/bits/iterator_concepts.h (__detail::__decay_copy)
1413 (__detail::__member_begin, __detail::__adl_begin): Move here from
1414 <bits/range_access.h>.
1415 (__detail::__ranges_begin, __detail::__range_iter_t): Define.
1416 * bits/range_access.h (__cust_access::__decay_copy)
1417 (__cust_access::__member_begin, __cust_access::__adl_begin): Move to
1418 <bits/iterator_concepts.h>.
1419 (ranges::iterator_t): Use __detail::__range_iter_t.
1420 * include/bits/stl_iterator.h (back_insert_iterator): Simplify
1421 conditional compilation. Add _GLIBCXX20_CONSTEXPR to all members.
1422 (front_insert_iterator): Likewise.
1423 (insert_iterator): Implement changes from P0896R4 for C++20.
1424 * testsuite/24_iterators/back_insert_iterator/constexpr.cc: New test.
1425 * testsuite/24_iterators/front_insert_iterator/constexpr.cc: New test.
1426 * testsuite/24_iterators/headers/iterator/synopsis_c++17.cc: Adjust
1427 for inclusion in synopsis_c++20.cc which expects different signatures
1428 for some function templates.
1429 * testsuite/24_iterators/insert_iterator/constexpr.cc: New test.
1431 * include/std/type_traits (__is_array_convertible): Move definition
1432 to immediately after is_convertible.
1434 2020-03-26 Jonathan Wakely <jwakely@redhat.com>
1436 * include/std/chrono (chrono::days, chrono::weeks, chrono::years)
1437 (chrono::months, chrono::sys_days, chrono::local_t)
1438 (chrono::local_time, chrono::local_seconds, chrono::local_days):
1440 (chrono::time_point): Add missing static assert.
1441 * testsuite/20_util/time_point/requirements/duration_neg.cc: New test.
1442 * testsuite/std/time/clock/file/overview.cc: New test.
1443 * testsuite/std/time/clock/file/members.cc: New test.
1444 * testsuite/std/time/syn_c++20.cc: New test.
1446 2020-03-25 Mike Crowe <mac@mcrowe.com>
1448 * testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
1450 * testsuite/30_threads/shared_timed_mutex/try_lock_until/2.cc: New
1453 2020-03-25 Jonathan Wakely <jwakely@redhat.com>
1455 * include/bits/fs_fwd.h (filesystem::__file_clock): Move to ...
1456 * include/std/chrono (filesystem::__file_clock): Here.
1457 (filesystem::__file_clock::from_sys, filesystem::__file_clock::to_sys):
1458 Define public member functions for C++20.
1459 (is_clock, is_clock_v): Define traits for C++20.
1460 * include/std/condition_variable (condition_variable::wait_until): Add
1461 check for valid clock.
1462 * include/std/future (_State_baseV2::wait_until): Likewise.
1463 * include/std/mutex (__timed_mutex_impl::_M_try_lock_until): Likewise.
1464 * include/std/shared_mutex (shared_timed_mutex::try_lock_shared_until):
1466 * include/std/thread (this_thread::sleep_until): Likewise.
1467 * testsuite/30_threads/condition_variable/members/2.cc: Qualify
1468 slow_clock with new namespace.
1469 * testsuite/30_threads/condition_variable/members/clock_neg.cc: New
1471 * testsuite/30_threads/condition_variable_any/members/clock_neg.cc:
1473 * testsuite/30_threads/future/members/clock_neg.cc: New test.
1474 * testsuite/30_threads/recursive_timed_mutex/try_lock_until/3.cc:
1475 Qualify slow_clock with new namespace.
1476 * testsuite/30_threads/recursive_timed_mutex/try_lock_until/
1477 clock_neg.cc: New test.
1478 * testsuite/30_threads/shared_future/members/clock_neg.cc: New
1480 * testsuite/30_threads/shared_lock/locking/clock_neg.cc: New test.
1481 * testsuite/30_threads/shared_timed_mutex/try_lock_until/clock_neg.cc:
1483 * testsuite/30_threads/timed_mutex/try_lock_until/3.cc: Qualify
1484 slow_clock with new namespace.
1485 * testsuite/30_threads/timed_mutex/try_lock_until/4.cc: Likewise.
1486 * testsuite/30_threads/timed_mutex/try_lock_until/clock_neg.cc: New
1488 * testsuite/30_threads/unique_lock/locking/clock_neg.cc: New test.
1489 * testsuite/std/time/traits/is_clock.cc: New test.
1490 * testsuite/util/slow_clock.h (slow_clock): Move to __gnu_test
1493 2020-03-21 Jonathan Wakely <jwakely@redhat.com>
1496 * include/experimental/bits/fs_path.h (path::generic_string<C,T,A>()):
1497 * testsuite/experimental/filesystem/path/generic/generic_string.cc:
1498 Improve test coverage.
1501 * include/bits/fs_path.h (path::_S_str_convert): Replace first
1502 parameter with basic_string_view so that strings with different
1503 allocators can be accepted.
1504 (path::generic_string<C,T,A>()): Use basic_string object that uses the
1505 right allocator type.
1506 * testsuite/27_io/filesystem/path/generic/94242.cc: New test.
1507 * testsuite/27_io/filesystem/path/generic/generic_string.cc: Improve
1510 2020-03-18 Jonathan Wakely <jwakely@redhat.com>
1513 * include/std/type_traits (__is_nt_default_constructible_atom): Remove.
1514 (__is_nt_default_constructible_impl): Remove.
1515 (__is_nothrow_default_constructible_impl): Remove.
1516 (__is_nt_constructible_impl): Add bool template parameter. Adjust
1517 partial specializations.
1518 (__is_nothrow_constructible_impl): Replace class template with alias
1520 (is_nothrow_default_constructible): Derive from alias template
1521 __is_nothrow_constructible_impl instead of
1522 __is_nothrow_default_constructible_impl.
1523 * testsuite/20_util/is_nothrow_constructible/94003.cc: New test.
1525 * include/std/stop_token (stop_token::_Stop_state_ref): Define
1526 comparison operators explicitly if the compiler won't synthesize them.
1528 * include/bits/stl_algobase.h (__lexicographical_compare_aux): Check
1529 __cpp_lib_concepts before using iter_reference_t.
1530 * include/bits/stream_iterator.h (istream_iterator): Check
1531 __cpp_lib_concepts before using default_sentinel_t.
1532 * include/bits/streambuf_iterator.h (istreambuf_iterator): Likewise.
1535 * include/experimental/executor (executor::executor(Executor)): Call
1536 make_shared directly instead of _M_create. Create _Tgt1 object.
1537 (executor::executor(allocator_arg_t, const ProtoAlloc&, Executor)):
1538 Call allocate_shared directly instead of _M_create. Create _Tgt2
1540 (executor::target_type): Add cast needed for new _Tgt interface.
1541 (executor::target): Define when RTTI is disabled. Use _Tgt::_M_func.
1542 (executor::_Tgt): Define the same interface whether RTTI is enabled or
1544 (executor::_Tgt::target_type, executor::_Tgt::target): Do not use
1545 std::type_info in the interface.
1546 (executor::_Tgt::_M_func): Add data member.
1547 (executor::_TgtImpl): Replace with _Tgt1 and _Tgt2 class templates.
1548 (executor::_Tgt1::_S_func): Define function to access target without
1550 (executor::_M_create): Remove.
1551 (operator==, operator!=): Simplify comparisons for executor.
1552 * include/experimental/socket (is_error_code_enum<socket_errc>):
1553 Define specialization before use.
1554 * testsuite/experimental/net/executor/1.cc: New test.
1556 2020-03-16 Jonathan Wakely <jwakely@redhat.com>
1559 * include/experimental/executor (service_already_exists): Add default
1560 constructor. Declare make_service to be a friend.
1561 * testsuite/experimental/net/execution_context/make_service.cc: New
1564 2020-03-12 Jonathan Wakely <jwakely@redhat.com>
1566 * testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
1567 a null pointer to functions with nonnull(1) attribute.
1569 2020-03-11 Patrick Palka <ppalka@redhat.com>
1571 * include/std/ranges (split_view::_OuterIter::_OuterIter): Typo fix,
1572 'address' -> 'std::__addressof'.
1573 * testsuite/std/ranges/adaptors/split.cc: Test taking the split_view of
1574 a non-forward input_range.
1575 * testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Make
1576 default constructor protected instead of deleted, like with
1577 input_iterator_wrapper.
1578 (test_range::iterator): Add comment explaining that this type is used
1579 only when the underlying wrapper is input_iterator_wrapper or
1580 output_iterator_wrapper. Remove delegating defaulted constructor so
1581 that the inherited default constructor is used instead.
1583 LWG 3286 ranges::size is not required to be valid after a call to
1584 ranges::begin on an input range
1585 * include/std/ranges (subrange::subrange): Split single-argument
1586 constructor into two, one constrained by _S_store_size and another by
1588 (take_view::begin): Call size() before calling ranges::begin(_M_base).
1589 * testsuite/std/ranges/adaptors/lwg3286.cc: New test.
1590 * testsuite/std/ranges/subrange/lwg3286.cc: New test.
1592 2020-03-10 Jonathan Wakely <jwakely@redhat.com>
1594 * include/std/ranges (split_view::_OuterIter::__at_end): Use __current
1595 instead of _M_current.
1596 (split_view::_OuterIter::operator++): Likewise.
1598 * include/std/ranges (transform_view::_Iterator::__iter_move): Remove.
1599 (transform_view::_Iterator::operator*): Add noexcept-specifier.
1600 (transform_view::_Iterator::iter_move): Inline __iter_move body here.
1601 (split_view::_OuterIter::__current): Add noexcept.
1602 (split_view::_InnerIter::__iter_swap): Remove.
1603 (split_view::_InnerIter::__iter_move): Remove.
1604 (split_view::_InnerIter::_M_i_current): New accessors.
1605 (split_view::_InnerIter::__at_end): Use _M_i_current().
1606 (split_view::_InnerIter::operator*): Likewise.
1607 (split_view::_InnerIter::operator++): Likewise.
1608 (iter_move(const _InnerIter&)): Likewise.
1609 (iter_swap(const _InnerIter&, const _InnerIter&)): Likewise.
1610 * testsuite/std/ranges/adaptors/split.cc: Check noexcept-specifier
1611 for iter_move and iter_swap on split_view's inner iterator.
1614 * include/std/ranges (ranges::transform_view::_Iterator::iter_move):
1615 Change expression in noexcept-specifier to match function body.
1617 * testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Add
1618 comment explaining multiple dg-do directives.
1619 * testsuite/24_iterators/ostream_iterator/1.cc: Fix do-do directive
1620 so test is run as well as compiled.
1622 2020-03-09 Jonathan Wakely <jwakely@redhat.com>
1625 * src/c++17/fs_path.cc (path::operator+=(const path&)): Add kluge to
1626 handle concatenations that change the type of the first component.
1627 (path::operator+=(basic_string_view<value_type>)): Likewise.
1628 * testsuite/27_io/filesystem/path/concat/94063.cc: New test.
1630 2020-03-06 Patrick Palka <ppalka@redhat.com>
1632 * include/std/ranges (join_view::_Sentinel<_Const>): Befriend
1633 join_view::_Sentinel<!_Const>.
1634 * testsuite/std/ranges/adaptors/join.cc: Augment test.
1637 * include/bits/range_access.h (__cust_access::_Empty::operator()):
1638 Declare return type to be bool instead of auto.
1639 * testsuite/std/ranges/adaptors/93978.cc: New test.
1641 2020-03-06 Jonathan Wakely <jwakely@redhat.com>
1644 * include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
1645 (__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
1646 second argument to __glibcxx_rwlock_init.
1647 * testsuite/30_threads/shared_timed_mutex/94069.cc: New test.
1650 * testsuite/27_io/filesystem/path/generic/generic_string.cc: Adjust
1651 test to not fail due to PR 94063.
1652 * testsuite/27_io/filesystem/path/generic/utf.cc: Likewise.
1653 * testsuite/27_io/filesystem/path/generic/wchar_t.cc: Likewise.
1655 2020-03-06 Andreas Krebbel <krebbel@linux.ibm.com>
1657 * src/c++11/system_error.cc: Omit the ENOTSUP case statement if it
1660 2020-03-05 Jonathan Wakely <jwakely@redhat.com>
1662 * testsuite/27_io/filesystem/operations/all.cc: Mark unused variable.
1663 * testsuite/27_io/filesystem/operations/copy.cc: Fix typo.
1664 * testsuite/experimental/filesystem/operations/copy.cc: Likewise.
1665 * testsuite/27_io/filesystem/operations/file_size.cc: Use correct type
1666 for return value, and in comparison.
1667 * testsuite/experimental/filesystem/operations/file_size.cc: Likewise.
1670 * include/std/string_view: Include <bits/ostream_insert.h>.
1671 * testsuite/21_strings/basic_string_view/inserters/94051.cc: New test.
1673 2020-03-04 Jonathan Wakely <jwakely@redhat.com>
1675 * include/bits/cpp_type_traits.h (__memcpyable): Fix comment.
1677 2020-03-04 Patrick Palka <ppalka@redhat.com>
1680 * include/bits/ranges_algobase.h (__fill_n_fn::operator()): Refine
1681 condition for when to use memset, making sure to additionally check that
1682 the output pointer's value type is a non-volatile byte type. Instead of
1683 requiring that the fill type is a byte type, just require that it's an
1685 * testsuite/20_util/specialized_algorithms/uninitialized_fill/94017.cc:
1687 * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/94017.cc:
1689 * testsuite/25_algorithms/fill/94013.cc: Uncomment part of test that was
1690 blocked by PR 94017.
1691 * testsuite/25_algorithms/fill/94017.cc: New test.
1692 * testsuite/25_algorithms/fill_n/94017.cc: New test.
1694 LWG 3355 The memory algorithms should support move-only input iterators
1696 * include/bits/ranges_uninitialized.h
1697 (__uninitialized_copy_fn::operator()): Use std::move to avoid attempting
1698 to copy __ifirst, which could be a move-only input iterator. Use
1699 operator- instead of ranges::distance to compute distance from a sized
1701 (__uninitialized_copy_n_fn::operator()): Likewise.
1702 (__uninitialized_move_fn::operator()): Likewise.
1703 (__uninitialized_move_n_fn::operator()): Likewise.
1704 (__uninitialized_destroy_fn::operator()): Use std::move to avoid
1705 attempting to copy __first.
1706 (__uninitialized_destroy_n_fn::operator()): Likewise.
1707 * testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
1709 * .../specialized_algorithms/uninitialized_copy/constrained.cc:
1711 * .../specialized_algorithms/uninitialized_move/constrained.cc:
1714 * testsuite/util/testsuite_iterators.h (test_range::get_iterator): Make
1715 protected instead of private.
1716 (test_sized_range_sized_sent): New.
1718 * testsuite/util/testsuite_iterators.h (input_iterator_wrapper_nocopy):
1719 New testsuite iterator.
1720 * testsuite/24_iterators/counted_iterator/lwg3389.cc: use it.
1721 * testsuite/24_iterators/move_iterator/lwg3390.cc: Likewise.
1723 * include/bits/ranges_uninitialized.h
1724 (uninitialized_copy_fn::operator()): Pass a reference type as the first
1725 argument to is_nothrow_assignable_v.
1726 (uninitialized_copy_fn::operator()): Likewise.
1727 (uninitialized_move_fn::operator()): Likewise. Return an in_out_result
1728 with the input iterator stripped of its move_iterator.
1729 (uninitialized_move_n_fn::operator()): Likewise.
1730 (uninitialized_fill_fn::operator()): Pass a reference type as the first
1731 argument to is_nothrow_assignable_v.
1732 (uninitialized_fill_n_fn::operator()): Likewise.
1734 2020-03-03 Jonathan Wakely <jwakely@redhat.com>
1737 * include/bits/cpp_type_traits.h (__memcpyable, __memcmpable): New
1738 traits to control when to use memmove and memcmp optimizations.
1739 (__is_nonvolatile_trivially_copyable): New helper trait.
1740 * include/bits/ranges_algo.h (__lexicographical_compare_fn): Do not
1741 use memcmp optimization with volatile data.
1742 * include/bits/ranges_algobase.h (__equal_fn): Use __memcmpable.
1743 (__copy_or_move, __copy_or_move_backward): Use __memcpyable.
1744 * include/bits/stl_algobase.h (__copy_move_a2): Use __memcpyable.
1745 (__copy_move_backward_a2): Likewise.
1746 (__equal_aux1): Use __memcmpable.
1747 (__lexicographical_compare_aux): Do not use memcmp optimization with
1749 * testsuite/25_algorithms/copy/94013.cc: New test.
1750 * testsuite/25_algorithms/copy_backward/94013.cc: New test.
1751 * testsuite/25_algorithms/equal/94013.cc: New test.
1752 * testsuite/25_algorithms/fill/94013.cc: New test.
1753 * testsuite/25_algorithms/lexicographical_compare/94013.cc: New test.
1754 * testsuite/25_algorithms/move/94013.cc: New test.
1755 * testsuite/25_algorithms/move_backward/94013.cc: New test.
1757 * include/bits/stl_algobase.h (lexicographical_compare_three_way):
1758 Avoid redundant iterator comparisons (LWG 3410).
1760 2020-03-02 Jonathan Wakely <jwakely@redhat.com>
1763 * include/bits/stl_algobase.h (__memcmp): Allow pointer types to
1765 * testsuite/25_algorithms/lexicographical_compare/uchar.cc: New test.
1767 * include/std/ranges (__detail::__maybe_empty_t): Rename to
1769 (__adaptor::_RangeAdaptor, join_view, split_view): Use new name.
1771 * include/bits/ranges_algo.h (shift_right): Add 'typename' to
1774 2020-03-01 H.J. Lu <hongjiu.lu@intel.com>
1776 * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
1778 2020-02-29 John David Anglin <danglin@gcc.gnu.org>
1780 * testsuite/17_intro/headers/c++1998/charset.cc: Skip on *-*-hpux*.
1781 * testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
1782 * testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
1783 * testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
1784 * testsuite/17_intro/headers/c++2020/charset.cc: Likewise.
1786 * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
1787 Add libatomic option.
1788 * testsuite/30_threads/jthread/jthread.cc: Likewise.
1790 2020-02-29 François Dumont <fdumont@gcc.gnu.org>
1792 * include/bits/stl_algo.h
1793 (__find_if, __count_if, __is_permutation, std::is_permutation): Move...
1794 * include/bits/stl_algobase.h: ...here.
1795 * include/bits/hashtable_policy.h: Remove <bits/stl_algo.h> include.
1797 2020-02-29 John David Anglin <danglin@gcc.gnu.org>
1799 * testsuite/30_threads/stop_token/stop_callback.cc: Add libatomic
1801 * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc:
1803 * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: Likewise.
1804 * testsuite/30_threads/stop_token/stop_callback/destroy.cc: Likewise.
1805 * testsuite/30_threads/stop_token/stop_callback/invoke.cc: Likewise.
1806 * testsuite/30_threads/stop_token/stop_source.cc: Likewise.
1807 * testsuite/30_threads/stop_token/stop_source/assign.cc: Likewise.
1808 * testsuite/30_threads/stop_token/stop_token.cc: Likewise.
1809 * testsuite/30_threads/stop_token/stop_token/stop_possible.cc:
1813 * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
1815 2020-02-28 Patrick Palka <ppalka@redhat.com>
1818 * include/bits/ranges_algo.h (__lexicographical_compare_fn::operator()):
1819 Fix condition for when to use memcmp, making it consistent with the
1820 corresponding condition used in std::lexicographical_compare.
1821 * testsuite/25_algorithms/lexicographical_compare/93972.cc: New test.
1823 * testsuite/26_numerics/headers/numeric/synopsis.cc: Add signatures for
1824 functions introduced in C++11, C++17 and C++2a. Add 'constexpr' to
1825 existing signatures for C++2a.
1827 2020-02-28 Jonathan Wakely <jwakely@redhat.com>
1829 * testsuite/24_iterators/range_operations/advance_debug_neg.cc: Run
1830 test instead of just compiling it.
1832 2020-02-28 Patrick Palka <ppalka@redhat.com>
1834 * include/std/ranges (reverse_view::_S_needs_cached_begin): Set to false
1835 whenever the underlying range models common_range.
1837 * include/std/ranges (__detail::_CachedPosition): New struct.
1838 (views::filter_view::_S_needs_cached_begin): New member variable.
1839 (views::filter_view::_M_cached_begin): New member variable.
1840 (views::filter_view::begin): Use _M_cached_begin to cache its
1842 (views::drop_view::_S_needs_cached_begin): New static member variable.
1843 (views::drop_view::_M_cached_begin): New member variable.
1844 (views::drop_view::begin): Use _M_cached_begin to cache its result
1845 when _S_needs_cached_begin.
1846 (views::drop_while_view::_M_cached_begin): New member variable.
1847 (views::drop_while_view::begin): Use _M_cached_begin to cache its
1849 (views::reverse_view::_S_needs_cached_begin): New static member
1851 (views::reverse_view::_M_cached_begin): New member variable.
1852 (views::reverse_view::begin): Use _M_cached_begin to cache its result
1853 when _S_needs_cached_begin.
1854 * testsuite/std/ranges/adaptors/drop.cc: Augment test to check that
1855 drop_view::begin caches its result.
1856 * testsuite/std/ranges/adaptors/drop_while.cc: Augment test to check
1857 that drop_while_view::begin caches its result.
1858 * testsuite/std/ranges/adaptors/filter.cc: Augment test to check that
1859 filter_view::begin caches its result.
1860 * testsuite/std/ranges/adaptors/reverse.cc: Augment test to check that
1861 reverse_view::begin caches its result.
1863 2020-02-28 Jonathan Wakely <jwakely@redhat.com>
1865 * testsuite/27_io/filesystem/operations/last_write_time.cc: Fixes for
1866 filesystems that silently truncate timestamps.
1867 * testsuite/experimental/filesystem/operations/last_write_time.cc:
1870 * testsuite/21_strings/basic_string/cons/char/1.cc: Disable
1871 -Wstringop-overflow warnings.
1873 2020-02-27 Jonathan Wakely <jwakely@redhat.com>
1875 * testsuite/lib/libstdc++.exp (v3_target_compile): Add
1876 -fdiagnostics-urls=never to options.
1878 2020-02-27 Patrick Palka <ppalka@redhat.com>
1880 * include/std/ranges (transform_view::_Iterator<_Const>): Befriend
1882 (transform_view::_Sentinel<_Const>): Befriend _Sentinel<!_Const>.
1883 (take_view::_Sentinel<_Const>): Likewise.
1884 (take_while_view::_Sentinel<_Const>): Likewise.
1885 (split_view::_OuterIter<_Const>): Befriend _OuterIter<!_Const>.
1886 * testsuite/std/ranges/adaptors/split.cc: Augment test.
1887 * testsuite/std/ranges/adaptors/take.cc: Augment test.
1888 * testsuite/std/ranges/adaptors/take_while.cc: Augment test.
1889 * testsuite/std/ranges/adaptors/transform.cc: Augment test.
1891 * testsuite/25_algorithms/copy/constrained.cc: Don't assume that the
1892 base() of a vector<>::iterator is a pointer.
1893 * testsuite/25_algorithms/copy_backward/constrained.cc: Likewise.
1894 * testsuite/25_algorithms/move/constrained.cc: Likewise.
1895 * testsuite/25_algorithms/move_backward/constrained.cc: Likewise.
1896 * testsuite/25_algorithms/inplace_merge/constrained.cc: Use foo.data()
1898 * testsuite/25_algorithms/partial_sort/constrained.cc: Likewise.
1899 * testsuite/25_algorithms/partial_sort_copy/constrained.cc: Likewise.
1900 * testsuite/25_algorithms/shuffle/constrained.cc: Likewise.
1901 * testsuite/25_algorithms/sort/constrained.cc: Likewise.
1902 * testsuite/25_algorithms/stable_sort/constrained.cc: Likewise.
1904 2020-02-27 Jonathan Wakely <jwakely@redhat.com>
1906 * include/debug/array (operator<=>): Define for C++20.
1907 * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
1908 Adjust dg-error line numbers.
1909 * testsuite/23_containers/array/tuple_interface/
1910 tuple_element_debug_neg.cc: Likewise.
1912 * testsuite/23_containers/span/back_assert_neg.cc: Add #undef before
1913 defining _GLIBCXX_ASSERTIONS.
1914 * testsuite/23_containers/span/first_2_assert_neg.cc: Likewise.
1915 * testsuite/23_containers/span/first_assert_neg.cc: Likewise.
1916 * testsuite/23_containers/span/front_assert_neg.cc: Likewise.
1917 * testsuite/23_containers/span/index_op_assert_neg.cc: Likewise.
1918 * testsuite/23_containers/span/last_2_assert_neg.cc: Likewise.
1919 * testsuite/23_containers/span/last_assert_neg.cc: Likewise.
1920 * testsuite/23_containers/span/subspan_2_assert_neg.cc: Likewise.
1921 * testsuite/23_containers/span/subspan_3_assert_neg.cc: Likewise.
1922 * testsuite/23_containers/span/subspan_4_assert_neg.cc: Likewise.
1923 * testsuite/23_containers/span/subspan_5_assert_neg.cc: Likewise.
1924 * testsuite/23_containers/span/subspan_6_assert_neg.cc: Likewise.
1925 * testsuite/23_containers/span/subspan_assert_neg.cc: Likewise.
1927 * include/debug/string (__gnu_debug::basic_string::insert): Fix for
1928 C++98 where the member function of the base class returns void.
1930 * testsuite/util/testsuite_iterators.h (forward_iterator_wrapper): Add
1931 equality comparisons that support value-initialized iterators.
1933 * include/bits/boost_concept_check.h (__function_requires): Add
1934 _GLIBCXX14_CONSTEXPR.
1935 * testsuite/25_algorithms/min/concept_checks.cc: New test.
1937 2020-02-26 Patrick Palka <ppalka@redhat.com>
1940 * include/std/ranges (split_view::_InnerIter::operator==): Compare
1941 the operands' _M_i rather than their _M_i.current().
1942 * testsuite/std/ranges/adaptors/split.cc: Augment test.
1944 P1645R1 constexpr for <numeric> algorithms
1945 * include/bits/stl_numeric.h (iota, accumulate, inner_product,
1946 partial_sum, adjacent_difference): Make conditionally constexpr for
1948 * include/std/numeric (__cpp_lib_constexpr_numeric): Define this feature
1950 (reduce, transform_reduce, exclusive_scan, inclusive_scan,
1951 transform_exclusive_scan, transform_inclusive_scan): Make conditionally
1952 constexpr for C++20.
1953 * include/std/version (__cpp_lib_constexpr_numeric): Define.
1954 * testsuite/26_numerics/accumulate/constexpr.cc: New test.
1955 * testsuite/26_numerics/adjacent_difference/constexpr.cc: Likewise.
1956 * testsuite/26_numerics/exclusive_scan/constexpr.cc: Likewise.
1957 * testsuite/26_numerics/inclusive_scan/constexpr.cc: Likewise.
1958 * testsuite/26_numerics/inner_product/constexpr.cc: Likewise.
1959 * testsuite/26_numerics/iota/constexpr.cc: Likewise.
1960 * testsuite/26_numerics/partial_sum/constexpr.cc: Likewise.
1961 * testsuite/26_numerics/reduce/constexpr.cc: Likewise.
1962 * testsuite/26_numerics/transform_exclusive_scan/constexpr.cc: Likewise.
1963 * testsuite/26_numerics/transform_inclusive_scan/constexpr.cc: Likewise.
1964 * testsuite/26_numerics/transform_reduce/constexpr.cc: Likewise.
1966 2020-02-26 Jonathan Wakely <jwakely@redhat.com>
1968 * include/bits/ranges_algo.h (__lexicographical_compare_fn): Declare
1969 variables in smaller scope and avoid calling ranges::distance when we
1970 know they are pointers. Remove statically-unreachable use of
1971 __builtin_unreachable().
1972 * include/bits/stl_algobase.h (__lexicographical_compare::__lc):
1975 * include/std/ranges (__detail::__maybe_empty_t): Define new helper
1977 (__detail::__maybe_const_t): Likewise.
1978 (__adaptor::_RangeAdaptor): Use __maybe_empty_t.
1979 (transform_view, take_view, take_while_view, elements_view): Use
1981 (join_view, split_view): Use both.
1983 2020-02-25 Patrick Palka <ppalka@redhat.com>
1985 LWG 3397 basic_istream_view::iterator should not provide
1987 * include/std/ranges (basic_istream_view:_Iterator::iterator_category):
1989 (basic_istream_view:_Iterator::iterator_concept): ... this.
1990 * testsuite/std/ranges/istream_view.cc: Augment test.
1992 LWG 3325 Constrain return type of transformation function for
1994 * include/std/ranges (transform_view): Constrain the return type of the
1995 transformation function as per LWG 3325.
1996 * testsuite/std/ranges/adaptors/lwg3325_neg.cc: New test.
1998 LWG 3313 join_view::_Iterator::operator-- is incorrectly constrained
1999 * include/std/ranges (join_view::_Iterator::operator--): Require that
2000 range_reference_t<_Base> models common_range.
2001 * testsuite/std/ranges/adaptors/lwg3313_neg.cc: New test.
2003 LWG 3301 transform_view::_Iterator has incorrect iterator_category
2004 * include/std/ranges (transform_view::_Iterator::_S_iter_cat): Adjust
2005 determination of iterator_category as per LWG 3301.
2006 * testsuite/std/ranges/adaptors/transform.cc: Augment test.
2008 LWG 3292 iota_view is under-constrained
2009 * include/std/ranges (iota_view): Require that _Winc models semiregular
2011 * testsuite/std/ranges/iota/lwg3292_neg.cc: New test.
2013 2020-02-25 Jonathan Wakely <jwakely@redhat.com>
2015 * include/bits/ranges_algobase.h (__copy_or_move): Do not use memmove
2016 during constant evaluation. Call __builtin_memmove directly instead of
2018 (__copy_or_move_backward): Likewise.
2019 * include/bits/stl_algobase.h (__memmove): Remove.
2020 (__copy_move<M, true, random_access_iterator_tag>::__copy_m)
2021 (__copy_move_backward<M, true, random_access_iterator_tag>::__copy_m):
2022 Use __builtin_memmove directly instead of __memmove.
2023 (__copy_move_a2): Do not use memmove during constant evaluation.
2024 (__copy_move_backward_a2): Use _IsMove constant to select correct
2025 __copy_move_backward specialization.
2026 * testsuite/25_algorithms/copy_backward/constexpr.cc: Check for copies
2027 begin turned into moves during constant evaluation.
2029 * testsuite/25_algorithms/move_backward/93872.cc: Add test left out of
2033 * include/bits/stl_algobase.h (__memmove): Cast away const before
2034 doing move assignment.
2035 * testsuite/25_algorithms/move/93872.cc: New test.
2036 * testsuite/25_algorithms/move_backward/93872.cc: New test.
2038 2020-02-24 Patrick Palka <ppalka@redhat.com>
2041 * include/bits/ranges_algobase.h (__copy_or_move,
2042 __copy_or_move_backward): Don't inspect the iter_value_t of the output
2043 iterator, instead inspect its iterator_traits directly.
2044 * include/bits/stl_iterator.h (back_insert_iterator::container):
2045 Conditionally initialize.
2046 (back_insert_iterator::difference_type): Conditionally define.
2047 (back_insert_iterator::back_insert_iterator): Conditionally define this
2048 default constructor.
2049 (front_insert_iterator::container): Conditionally initialize.
2050 (front_insert_iterator::difference_type): Conditionally define.
2051 (front_insert_iterator::front_insert_iterator): Conditionally define
2052 this default constructor.
2053 * 24_iterators/back_insert_iterator/pr93884.cc: New test.
2054 * 24_iterators/front_insert_iterator/pr93884.cc: New test.
2056 P0769R2 Add shift to <algorithm>
2057 * include/bits/ranges_algo.h (shift_left, shift_right): New.
2058 * testsuite/25_algorithms/shift_left/1.cc: New test.
2059 * testsuite/25_algorithms/shift_right/1.cc: New test.
2061 2020-02-24 Jonathan Wakely <jwakely@redhat.com>
2063 * include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)):
2064 Make noexcept-specifier conditional.
2065 * testsuite/24_iterators/istream_iterator/cons/sentinel.cc: Check
2068 * include/bits/stream_iterator.h (istream_iterator(default_sentinel_t)):
2070 (operator==(istream_iterator, default_sentinel_t)): Add operator.
2071 (ostream_iterator::difference_type): Define to ptrdiff_t for C++20.
2072 * include/bits/streambuf_iterator.h
2073 (istreambuf_iterator(default_sentinel_t)): Add constructor.
2074 (operator==(istreambuf_iterator, default_sentinel_t)): Add operator.
2075 * testsuite/24_iterators/istream_iterator/cons/sentinel.cc:
2077 * testsuite/24_iterators/istream_iterator/sentinel.cc: New test.
2078 * testsuite/24_iterators/istreambuf_iterator/cons/sentinel.cc:
2080 * testsuite/24_iterators/istreambuf_iterator/sentinel.cc: New test.
2082 * include/std/ranges (__deep_const_range, __enable_view_impl): Remove.
2083 (ranges::enable_view): Simplify (LWG 3326).
2084 * include/bits/range_access.h (ranges::enable_view): Declare.
2085 * include/bits/regex.h (__enable_view_impl): Remove partial
2087 * include/bits/stl_multiset.h (__enable_view_impl): Likewise.
2088 * include/bits/stl_set.h (__enable_view_impl): Likewise.
2089 * include/bits/unordered_set.h (__enable_view_impl): Likewise.
2090 * include/debug/multiset.h (__enable_view_impl): Likewise.
2091 * include/debug/set.h (__enable_view_impl): Likewise.
2092 * include/debug/unordered_set (__enable_view_impl): Likewise.
2093 * include/experimental/string_view (ranges::enable_view): Define
2094 partial specialization.
2095 * include/std/span (ranges::enable_view): Likewise.
2096 * include/std/string_view (ranges::enable_view): Likewise.
2097 * testsuite/std/ranges/view.cc: Check satisfaction of updated concept.
2099 2020-02-21 Jonathan Wakely <jwakely@redhat.com>
2101 * include/std/optional (operator<=>(optional<T>, optional<U>))
2102 (operator<=>(optional<T>, nullopt), operator<=>(optional<T>, U)):
2104 * include/std/tuple (__tuple_cmp): New helper function for <=>.
2105 (operator<=>(tuple<T...>, tuple<U>...)): Define for C++20.
2106 * include/std/variant (operator<=>(variant<T...>, variant<T...>))
2107 (operator<=>(monostate, monostate)): Define for C++20.
2108 * testsuite/20_util/optional/relops/three_way.cc: New test.
2109 * testsuite/20_util/tuple/comparison_operators/three_way.cc: New test.
2110 * testsuite/20_util/variant/89851.cc: Move to ...
2111 * testsuite/20_util/variant/relops/89851.cc: ... here.
2112 * testsuite/20_util/variant/90008.cc: Move to ...
2113 * testsuite/20_util/variant/relops/90008.cc: ... here.
2114 * testsuite/20_util/variant/relops/three_way.cc: New test.
2116 2020-02-20 Patrick Palka <ppalka@redhat.com>
2118 * include/std/ranges (views::__adaptor::__maybe_refwrap): New utility
2120 (views::__adaptor::_RangeAdaptor::operator()): Add comments. Use
2121 __maybe_refwrap to capture lvalue references by reference, and then use
2122 unwrap_reference_t to forward the by-reference captures as references.
2123 * testsuite/std/ranges/adaptors/split.cc: Augment test.
2124 * testsuite/std/ranges/adaptors/split_neg.cc: New test.
2126 * include/std/ranges (iota_view): Forward declare _Sentinel.
2127 (iota_view::_Iterator): Befriend _Sentinel.
2128 (iota_view::_Sentinel::_M_equal): New member function.
2129 (iota_view::_Sentinel::operator==): Use it.
2130 (views::_Iota::operator()): Forward __f using the correct type.
2131 * testsuite/std/ranges/access/ssize.cc (test06): Don't call views::iota
2132 with integers of different signedness, to appease iota_view's deduction
2134 * testsuite/std/ranges/iota/iota_view.cc: Augment test.
2136 2020-02-20 Jonathan Wakely <jwakely@redhat.com>
2138 * include/bits/range_access.h (ranges::begin): Reject array of
2140 (ranges::end, ranges::size): Require arrays to be bounded.
2141 (ranges::data): Require lvalue or borrowed_range.
2142 (ranges::iterator_t): Remove constraint.
2143 * testsuite/std/ranges/access/begin.cc: Do not check array of
2145 * testsuite/std/ranges/access/begin_neg.cc: New test.
2146 * testsuite/std/ranges/access/end_neg.cc: Adjust expected error.
2147 * testsuite/std/ranges/access/size_neg.cc: Adjust expected error.
2148 * testsuite/std/ranges/access/ssize.cc: Do not check array of
2151 * include/std/system_error (error_category::operator<=>)
2152 (operator<=>(const error_code&, const error_code&))
2153 (operator<=>(const error_condition&, const error_condition&)): Define
2155 * testsuite/19_diagnostics/error_category/operators/less.cc: New test.
2156 * testsuite/19_diagnostics/error_category/operators/three_way.cc: New
2158 * testsuite/19_diagnostics/error_code/operators/equal.cc: Remove
2160 * testsuite/19_diagnostics/error_code/operators/less.cc: New test.
2161 * testsuite/19_diagnostics/error_code/operators/not_equal.cc: Remove
2163 * testsuite/19_diagnostics/error_code/operators/three_way.cc: New test.
2164 * testsuite/19_diagnostics/error_condition/operators/equal.cc: Remove
2166 * testsuite/19_diagnostics/error_condition/operators/less.cc: New test.
2167 * testsuite/19_diagnostics/error_condition/operators/not_equal.cc:
2168 Remove incorrect comment.
2169 * testsuite/19_diagnostics/error_condition/operators/three_way.cc: New
2172 * libsupc++/typeinfo (type_info::operator!=): Remove for C++20.
2174 * include/std/thread (thread::id::operator<=>): Define for C++20.
2175 * testsuite/30_threads/thread/id/70294.cc: Do not take addresses of
2176 functions in namespace std.
2177 * testsuite/30_threads/thread/id/operators_c++20.cc: New test.
2179 2020-02-19 Patrick Palka <ppalka@redhat.com>
2181 * testsuite/std/ranges/adaptors/split.cc (test03): Don't include the
2182 null terminator of the underlying string as part of the test_range.
2183 (main): Call test03.
2185 2020-02-19 Jonathan Wakely <jwakely@redhat.com>
2187 * include/bits/stl_iterator.h (common_iterator): Add copyable<I>
2188 requirement (LWG 3385).
2189 * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust
2190 expected declaration.
2192 * include/std/ranges (take_while_view, drop_view, drop_while_view)
2193 (elements_view:_Iterator): Initialize data members (LWG 3364).
2195 * libsupc++/compare (three_way_comparable): Remove always-false check
2196 that should have been removed with weak_equality (P1959R0).
2197 (three_way_comparable_with): Likewise. Reorder requirements (LWG 3360).
2199 * include/std/concepts (__detail::__partially_ordered_with): Move here
2201 (totally_ordered, totally_ordered_with): Use __partially_ordered_with
2202 to simplify definition (LWG 3331).
2203 * libsupc++/compare (__detail::__partially_ordered_with): Move to
2206 * include/std/concepts (totally_ordered_with): Remove redundant
2207 requirement (LWG 3329).
2209 * include/std/ranges (__detail::__convertible_to_non_slicing): New
2211 (__detail::__pair_like_convertible_to): Remove.
2212 (__detail::__pair_like_convertible_from): Add requirements for
2213 non-slicing conversions.
2214 (subrange): Constrain constructors with __convertible_to_non_slicing.
2215 Remove constructors from pair-like types. Add new deduction guide.
2216 * testsuite/std/ranges/subrange/lwg3282_neg.cc: New test.
2218 * include/bits/iterator_concepts.h (iter_move): Add declaration to
2219 prevent unqualified lookup finding a suitable declaration (LWG 3247).
2221 * include/std/memory_resource (polymorphic_allocator::allocate)
2222 (polymorphic_allocator::allocate_object): Change type of exception to
2223 bad_array_new_length (LWG 3237).
2224 * testsuite/20_util/polymorphic_allocator/lwg3237.cc: New test.
2226 * include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348).
2227 * include/std/version (__cpp_lib_unwrap_ref): Likewise.
2228 * testsuite/20_util/unwrap_reference/1.cc: Check macro.
2229 * testsuite/20_util/unwrap_reference/3.cc: New test.
2231 * include/std/numeric (midpoint(T8, T*)): Do not check for complete
2232 type during overload resolution, use static assert instead (LWG 3200).
2233 * testsuite/26_numerics/midpoint/pointer.cc: Do not test with
2235 * testsuite/26_numerics/midpoint/pointer_neg.cc: New test.
2237 * include/std/span (span(T (&)[N])): Use non-deduced context to
2238 prevent first parameter from interfering with class template argument
2239 deduction (LWG 3369).
2240 * testsuite/23_containers/span/deduction.cc: Add missing 'const'.
2241 * testsuite/23_containers/span/lwg3255.cc: Check for construction from
2244 * include/std/span (span::const_iterator, span::const_reverse_iterator)
2245 (span::cbegin(), span::cend(), span::crbegin(), span::crend()):
2247 * testsuite/23_containers/span/everything.cc: Replace uses of cbegin
2249 * testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
2251 * testsuite/20_util/specialized_algorithms/uninitialized_copy/
2252 constrained.cc: Likewise.
2253 * testsuite/20_util/specialized_algorithms/
2254 uninitialized_default_construct/constrained.cc: Likewise.
2255 * testsuite/20_util/specialized_algorithms/uninitialized_fill/
2256 constrained.cc: Likewise.
2257 * testsuite/20_util/specialized_algorithms/uninitialized_move/
2258 constrained.cc: Likewise.
2259 * testsuite/20_util/specialized_algorithms/
2260 uninitialized_value_construct/constrained.cc: Likewise.
2262 * include/bits/range_access.h (range_size_t): Define alias template.
2263 * include/std/ranges (all_view): Rename to views::all_t (LWG 3335).
2264 * testsuite/std/ranges/adaptors/filter.cc: Adjust to new name.
2266 * include/std/ranges (filter_view, transform_view, take_view)
2267 (join_view, split_view, reverse_view): Remove commented-out converting
2268 constructors (LWG 3280).
2270 * include/std/memory (uninitialized_construct_using_allocator): Use
2271 std::construct_at (LWG 3321).
2273 * include/std/memory_resource (polymorphic_allocator::allocate_bytes)
2274 (polymorphic_allocator::allocate_object)
2275 (polymorphic_allocator::new_object): Add nodiscard attribute (LWG3304).
2277 LWG 3379. "safe" in several library names is misleading
2278 * include/bits/range_access.h (enable_safe_range): Rename to
2279 enable_borrowed_range.
2280 (__detail::__maybe_safe_range): Rename to __maybe_borrowed_range.
2281 (safe_range): Rename to borrowed_range.
2282 * include/bits/ranges_algo.h: Adjust to use new names.
2283 * include/bits/ranges_algobase.h: Likewise.
2284 * include/bits/ranges_uninitialized.h: Likewise.
2285 * include/std/ranges: Likewise.
2286 (safe_iterator_t): Rename to borrowed_iterator_t.
2287 (safe_subrange_t): Rename to borrowed_subrange_t.
2288 * include/std/span: Adjust to use new names.
2289 * include/std/string_view: Likewise.
2290 * include/experimental/string_view: Likewise.
2291 * testsuite/std/ranges/access/begin.cc: Likewise.
2292 * testsuite/std/ranges/access/cbegin.cc: Likewise.
2293 * testsuite/std/ranges/access/cdata.cc: Likewise.
2294 * testsuite/std/ranges/access/cend.cc: Likewise.
2295 * testsuite/std/ranges/access/crbegin.cc: Likewise.
2296 * testsuite/std/ranges/access/crend.cc: Likewise.
2297 * testsuite/std/ranges/access/data.cc: Likewise.
2298 * testsuite/std/ranges/access/end.cc: Likewise.
2299 * testsuite/std/ranges/access/rbegin.cc: Likewise.
2300 * testsuite/std/ranges/access/rend.cc: Likewise.
2301 * testsuite/std/ranges/safe_range.cc: Likewise.
2302 * testsuite/std/ranges/safe_range_types.cc: Likewise.
2303 * testsuite/util/testsuite_iterators.h: Likewise.
2305 * include/std/ranges (tuple_element<0, const subrange<I, S, K>>)
2306 (tuple_element<1, const subrange<I, S, K>>): Add partial
2307 specializations (LWG 3398).
2308 * testsuite/std/ranges/subrange/tuple_like.cc: New test.
2310 * include/bits/ranges_algo.h (__find_fn, __find_first_of_fn)
2311 (__adjacent_find_fn, __remove_if_fn, __remove_copy_if_fn)
2312 (__unique_fn, __unique_copy_fn): Remove redundant conversions to bool.
2314 2020-02-18 Patrick Palka <ppalka@redhat.com>
2316 P1983R0 Wording for GB301, US296, US292, US291, and US283
2317 * include/std/ranges (filter_view::pred): New member function.
2318 (join_view::_Iterator::_Iterator): Remove now-redundant comment since
2319 P1983R0 fixes the highlighted issue in the same way.
2320 (join_view::_Iterator<_Const>): Add friend
2321 join_view::_Iterator<!_Const>.
2322 (join_view::_M_inner): Remove mutable specifier, effectively reverting
2323 the proposed wording changes of P3278.
2324 (join_view::begin): Refine the condition for when to return a const
2326 (split_view::_OuterIter::_OuterIter): Adjust constraints.
2327 * testsuite/std/ranges/adaptors/filter.cc: Test that filter_view::pred
2330 2020-02-18 Jonathan Wakely <jwakely@redhat.com>
2333 * include/std/ranges (_RangeAdaptor): Add deduction guide.
2334 (filter_view::_Iterator): Add alias _Vp_iter and use in place of
2336 (filter_view::_Iterator::_S_iter_cat()): Add 'typename'.
2337 (transform_view::_Iterator): Add alias _Base_iter and use in place of
2339 (transform_view::_Iterator::_S_iter_cat()): Add 'typename'.
2340 (join_view::_Iterator): Add _Outer_iter and _Inner_iter aliases.
2341 (join_view::_Iterator::_S_iter_cat()): Add 'typename'.
2342 (split_view::_InnerIter::_S_iter_cat()): Likewise.
2344 * testsuite/20_util/integer_comparisons/equal.cc: Fix invalid
2345 assumption that long is wider than int.
2346 * testsuite/20_util/integer_comparisons/greater_equal.cc: Likewise.
2347 * testsuite/20_util/integer_comparisons/less.cc: Likewise.
2348 * testsuite/20_util/integer_comparisons/less_equal.cc: Likewise.
2349 * testsuite/20_util/integer_comparisons/not_equal.cc: Likewise.
2351 P1976R2 Fixed-size span construction from dynamic range
2352 * include/std/span (__cpp_lib_span): Update value.
2353 (span(It, size_type), span(It, End)): Make conditionally explicit. Add
2355 (span(R&&), span(const span<OType, OExtent>&)): Likewise and relax
2357 (span::first<Count>(), span::last<Count>()): Use explicit type in
2359 (as_bytes, as_writable_bytes): Likewise.
2360 * include/std/version (__cpp_lib_span): Update value.
2361 * testsuite/23_containers/span/1.cc: Check new value.
2362 * testsuite/23_containers/span/2.cc: Check new value.
2363 * testsuite/23_containers/span/explicit.cc: New test.
2365 * include/std/span (span::__is_compatible_array): Simplify alias
2366 template by using requires-clause.
2367 (span::__is_compatible_ref): New alias template for constraining
2369 (span::__is_compatible_iterator, span::__is_compatible_range): Remove.
2370 (span(It, size_type), span(It, End)): Use __is_compatible_ref.
2371 (span(T(&)[N], span(array<T, N>&), span(const array<T, N>&)): Remove
2372 redundant parentheses.
2373 (span(R&&)): Add missing constraints.
2375 * include/std/span (span): Reorder members and rename template
2376 parameters to match declarations in the C++2a working paper.
2378 P2116R0 Remove tuple-like protocol support from fixed-extent span
2379 * include/std/span (get, tuple_size, tuple_element): Remove.
2380 * testsuite/23_containers/span/everything.cc: Remove checks for
2382 * testsuite/23_containers/span/get_neg.cc: Remove.
2383 * testsuite/23_containers/span/tuple_element_dynamic_neg.cc: Remove.
2384 * testsuite/23_containers/span/tuple_element_oob_neg.cc: Remove.
2385 * testsuite/23_containers/span/tuple_size_neg.cc: Remove.
2387 2020-02-17 Patrick Palka <ppalka@redhat.com>
2389 P2106R0 Alternative wording for GB315 and GB316
2390 * include/bits/ranges_algo.h (in_fun_result): New.
2391 (for_each_result, for_each_n_result): Change into an alias of
2393 (in_in_result): New.
2394 (mismatch_result): Change into an alias of in_in_result.
2395 (copy_if_result): Change into an alias of in_out_result.
2396 (swap_ranges_result): Change into an alias of in_in_result.
2397 (unary_transform_result): Change into an alias of in_out_result.
2398 (in_in_out_result): New.
2399 (binary_transform_result): Change into an alias of in_in_out_result.
2400 (replace_copy_result, replace_copy_if_result, remove_copy_if_result,
2401 remove_copy_result, unique_copy_result, reverse_copy_result,
2402 rotate_copy_result, partial_sort_copy_result): Change into an alias of
2404 (in_out_out_result): New.
2405 (partition_copy_result, merge_result): Change into an alias of
2407 (set_union_result, set_intersection_result): Change into an alias of
2409 (set_difference_result): Change into an alias of in_out_result.
2410 (set_symmetric_difference): Change into an alias of in_in_out_result.
2411 (min_max_result): New.
2412 (minmax_result, minmax_element_result): Change into an alias of
2414 (in_found_result): New.
2415 (next_permutation_result, prev_permutation_result): Change into an alias
2417 (__next_permutation_fn::operator(), __prev_permutation_fn::operator()):
2418 Adjust following changes to next_permutation_result and
2419 prev_permutation_result.
2420 * include/bits/ranges_algobase.h (in_out_result): New.
2421 (copy_result, move_result, move_backward_result, copy_backward_result,
2422 copy_n_result): Change into an alias of in_out_result.
2423 * include/bits/ranges_uninitialized.h (uninitialized_copy_result,
2424 uninitialized_copy_n_result, uninitialized_move_result,
2425 uninitialized_move_n_result): Likewise.
2426 * testsuite/25_algorithms/next_permutation/constrained.cc: Adjust uses of
2427 structured bindings.
2428 * testsuite/25_algorithms/prev_permutation/constrained.cc: Likewise.
2430 P1243R4 Rangify new algorithms
2431 * include/bits/ranges_algo.h (for_each_n_result, __for_each_n_fn,
2432 for_each_n, __sample_fn, sample, __clamp_fn, clamp): New.
2433 * testsuite/25_algorithms/clamp/constrained.cc: New test.
2434 * testsuite/25_algorithms/for_each/constrained.cc: Augment test.
2435 * testsuite/25_algorithms/sample/constrained.cc: New test.
2437 2020-02-17 Jonathan Wakely <jwakely@redhat.com>
2439 P1964R2 Wording for boolean-testable
2440 * include/bits/ranges_algo.h (__find_fn, __find_first_of_fn)
2441 (__adjacent_find_fn): Cast result of predicate to bool.
2442 * include/std/concepts (__boolean): Remove.
2443 (__detail::__boolean_testable_impl, __detail::__boolean_testable): Add
2444 new helper concepts.
2445 (__detail::__weakly_eq_cmp_with, totally_ordered, totally_ordered_with)
2446 (predicate): Use __boolean_testable instead of boolean.
2447 * libsupc++/compare (__detail::__partially_ordered, _Synth3way):
2450 P1970R2 Consistency for size() functions: Add ranges::ssize
2451 * include/bits/range_access.h (_SSize, ssize): Define for C++20.
2452 * testsuite/std/ranges/access/ssize.cc: New test.
2454 P1956R1 On the names of low-level bit manipulation functions
2455 * include/bits/hashtable_policy.h: Update comment.
2456 * include/std/bit (__ispow2, __ceil2, __floor2, __log2p1): Rename.
2457 (ispow2, ceil2, floor2, log2p1): Likewise.
2458 (__cpp_lib_int_pow2): Add feature test macro.
2459 * include/std/charconv (__to_chars_len_2): Adjust use of __log2p1.
2460 * include/std/memory (assume_aligned): Adjust use of ispow2.
2461 * include/std/version (__cpp_lib_int_pow2): Add.
2462 * libsupc++/new_opa.cc: Adjust use of __ispow2.
2463 * src/c++17/memory_resource.cc: Likewise, and for __ceil2 and __log2p1.
2464 * testsuite/17_intro/freestanding.cc: Adjust use of ispow2.
2465 * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Rename to ...
2466 * testsuite/26_numerics/bit/bit.pow.two/bit_ceil.cc: ... here.
2467 * testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: Rename to ...
2468 * testsuite/26_numerics/bit/bit.pow.two/bit_ceil_neg.cc: ... here.
2469 * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Rename to ...
2470 * testsuite/26_numerics/bit/bit.pow.two/bit_floor.cc: ... here.
2471 * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Rename to ...
2472 * testsuite/26_numerics/bit/bit.pow.two/bit_width.cc: ... here.
2473 * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Rename to ...
2474 * testsuite/26_numerics/bit/bit.pow.two/has_single_bit.cc: ... here.
2476 * include/std/charconv: Add comment.
2478 PR libstdc++/92546 (partial)
2479 * include/bits/random.h (uniform_random_bit_generator): Move definition
2480 to <bits/uniform_int_dist.h>.
2481 * include/bits/ranges_algo.h: Include <bits/uniform_int_dist.h> instead
2483 * include/bits/ranges_algobase.h: Do not include <cmath>.
2484 * include/bits/uniform_int_dist.h (uniform_random_bit_generator):
2486 * include/std/ranges: Do not include <limits>.
2487 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
2489 PR libstdc++/92546 (partial)
2490 * include/Makefile.am: Add new header.
2491 * include/Makefile.in: Regenerate.
2492 * include/bits/int_limits.h: New header.
2493 * include/bits/parse_numbers.h (__select_int::_Select_int): Replace
2494 numeric_limits with __detail::__int_limits.
2495 * include/std/bit (__rotl, __rotr, __countl_zero, __countl_one)
2496 (__countr_zero, __countr_one, __popcount, __ceil2, __floor2, __log2p1):
2498 * include/std/charconv (__to_chars_8, __from_chars_binary)
2499 (__from_chars_alpha_to_num, from_chars): Likewise.
2500 * include/std/memory_resource (polymorphic_allocator::allocate)
2501 (polymorphic_allocator::allocate_object): Likewise.
2502 * include/std/string_view (basic_string_view::_S_compare): Likewise.
2503 * include/std/utility (in_range): Likewise.
2504 * testsuite/20_util/integer_comparisons/in_range_neg.cc: Adjust for
2505 extra error about incomplete type __int_limits<bool>.
2506 * testsuite/26_numerics/bit/bit.count/countl_one.cc: Include <limits>.
2507 * testsuite/26_numerics/bit/bit.count/countl_zero.cc: Likewise.
2508 * testsuite/26_numerics/bit/bit.count/countr_one.cc: Likewise.
2509 * testsuite/26_numerics/bit/bit.count/countr_zero.cc: Likewise.
2510 * testsuite/26_numerics/bit/bit.count/popcount.cc: Likewise.
2511 * testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: Likewise.
2512 * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Likewise.
2513 * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise.
2514 * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise.
2515 * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise.
2516 * testsuite/26_numerics/bit/bit.rotate/rotl.cc: Likewise.
2517 * testsuite/26_numerics/bit/bit.rotate/rotr.cc: Likewise.
2519 * python/libstdcxx/v6/printers.py (StdCmpCatPrinter.to_string): Update
2520 value for partial_ordering::unordered.
2522 * include/bits/iterator_concepts.h (indirectly_copyable_storable): Add
2523 const-qualified expression variations.
2524 * include/std/concepts (copyable): Likewise.
2526 * include/std/type_traits (__is_standard_integer): New helper trait.
2527 * include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater)
2528 (cmp_less_equal, cmp_greater_equal, in_range): Define for C++20.
2529 * include/std/version (__cpp_lib_integer_comparison_functions): Define.
2530 * testsuite/20_util/integer_comparisons/1.cc: New test.
2531 * testsuite/20_util/integer_comparisons/2.cc: New test.
2532 * testsuite/20_util/integer_comparisons/equal.cc: New test.
2533 * testsuite/20_util/integer_comparisons/equal_neg.cc: New test.
2534 * testsuite/20_util/integer_comparisons/greater_equal.cc: New test.
2535 * testsuite/20_util/integer_comparisons/greater_equal_neg.cc: New test.
2536 * testsuite/20_util/integer_comparisons/greater_neg.cc: New test.
2537 * testsuite/20_util/integer_comparisons/in_range.cc: New test.
2538 * testsuite/20_util/integer_comparisons/in_range_neg.cc: New test.
2539 * testsuite/20_util/integer_comparisons/less.cc: New test.
2540 * testsuite/20_util/integer_comparisons/less_equal.cc: New test.
2541 * testsuite/20_util/integer_comparisons/less_equal_neg.cc: New test.
2542 * testsuite/20_util/integer_comparisons/less_neg.cc: New test.
2543 * testsuite/20_util/integer_comparisons/not_equal.cc: New test.
2544 * testsuite/20_util/integer_comparisons/not_equal_neg.cc: New test.
2546 2020-02-16 Patrick Palka <ppalka@redhat.com>
2548 * include/bits/ranges_algo.h (__lexicographical_compare_fn::operator()):
2549 Move code after an early exit constexpr if to under an else branch.
2550 * include/bits/ranges_algobase.h (__equal_fn::operator()): Likewise.
2552 2020-02-15 Patrick Palka <ppalka@redhat.com>
2554 * include/bits/ranges_algo.h: Adjust whitespace and formatting.
2555 * include/bits/ranges_algobase.h: Likewise.
2556 * include/bits/ranges_uninitialized.h: Likewise.
2558 * include/bits/ranges_algo.h: (adjacent_find, all_of, any_of,
2559 binary_search, copy_if, count, count_if, equal_range, find, find_end,
2560 find_first_of, find_if, find_if_not, for_each, generate, generate_n,
2561 includes, inplace_merge, is_heap, is_heap_until, is_partitioned,
2562 is_permutation, is_sorted, is_sorted_until, lexicographical_compare,
2563 lower_bound, make_heap, max, max_element, merge, min, min_element,
2564 minmax, minmax_element, mismatch, next_permutation, none_of,
2565 nth_element, partial_sort, partial_sort_copy, partition, partition_copy,
2566 partition_point, pop_heap, prev_permutation, push_heap, remove,
2567 remove_copy, remove_copy_if, remove_if, replace, replace_copy,
2568 replace_copy_if, replace_if, reverse, reverse_copy, rotate, rotate_copy,
2569 search, search_n, set_difference, set_intersection,
2570 set_symmetric_difference, set_union, shuffle, sort, sort_heap,
2571 stable_partition, stable_sort, swap_ranges, transform, unique,
2572 unique_copy, upper_bound): Convert into function objects.
2573 * include/bits/ranges_algobase.h: (equal, copy, move, copy_n, fill_n,
2574 fill, move_backward, copy_backward): Likewise.
2575 * include/bits/ranges_uninitialized.h (uninitialized_default_construct,
2576 uninitialized_default_construct_n, uninitialized_value_construct,
2577 uninitialized_value_construct_n, uninitialized_copy,
2578 uninitialized_copy_n, uninitialized_move, uninitialized_move_n,
2579 uninitialized_fill, uninitialized_fill_n, construct_at, destroy_at,
2580 destroy, destroy_n): Likewise.
2582 * include/bits/ranges_algo.h (ranges::__find_end): Fold into ...
2583 (ranges::find_end): ... here.
2584 (ranges::__lexicographical_compare): Fold into ...
2585 (ranges::lexicographical_compare): ... here.
2586 * include/bits/ranges_algobase.h (ranges::__equal): Fold into ...
2587 (ranges::equal): ... here.
2589 2020-02-15 Jonathan Wakely <jwakely@redhat.com>
2591 * include/bits/erase_if.h (__cpp_lib_erase_if): Define to 202002L.
2592 * include/std/deque: Likewise.
2593 * include/std/forward_list: Likewise.
2594 * include/std/list: Likewise.
2595 * include/std/string: Likewise.
2596 * include/std/vector: Likewise.
2597 * include/std/version: Likewise.
2598 * testsuite/23_containers/deque/erasure.cc: Test for new value.
2599 * testsuite/23_containers/forward_list/erasure.cc: Likewise.
2600 * testsuite/23_containers/list/erasure.cc: Likewise.
2601 * testsuite/23_containers/map/erasure.cc: Likewise.
2602 * testsuite/23_containers/set/erasure.cc: Likewise.
2603 * testsuite/23_containers/unordered_map/erasure.cc: Likewise.
2604 * testsuite/23_containers/unordered_set/erasure.cc: Likewise.
2605 * testsuite/23_containers/vector/erasure.cc: Likewise.
2607 2020-02-15 Jonathan Wakely <jwakely@redhat.com>
2609 * include/bits/random.h (uniform_random_bit_generator): Require min()
2610 and max() to be constant expressions and min() to be less than max().
2611 * testsuite/26_numerics/random/concept.cc: Check additional cases.
2612 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
2614 2020-02-13 Patrick Palka <ppalka@redhat.com>
2616 * include/Makefile.am: Add <bits/ranges_uninitialized.h>.
2617 * include/Makefile.in: Regenerate.
2618 * include/bits/ranges_uninitialized.h: New header.
2619 * include/std/memory: Include it.
2620 * testsuite/20_util/specialized_algorithms/destroy/constrained.cc: New
2622 * .../uninitialized_copy/constrained.cc: New test.
2623 * .../uninitialized_default_construct/constrained.cc: New test.
2624 * .../uninitialized_fill/constrained.cc: New test.
2625 * .../uninitialized_move/constrained.cc: New test.
2626 * .../uninitialized_value_construct/constrained.cc: New test.
2628 * include/Makefile.am: Add bits/ranges_algobase.h
2629 * include/Makefile.in: Regenerate.
2630 * bits/ranges_algo.h: Include <bits/ranges_algobase.h> and refactor
2632 (__detail::__is_normal_iterator, __detail::is_reverse_iterator,
2633 __detail::__is_move_iterator, copy_result, move_result,
2634 __equal, equal, copy_result, move_result, move_backward_result,
2635 copy_backward_result, __copy_or_move_backward, __copy_or_move, copy,
2636 move, copy_backward, move_backward, copy_n_result, copy_n, fill_n,
2637 fill): Split out into ...
2638 * bits/range_algobase.h: ... this new header.
2640 2020-02-12 Patrick Palka <ppalka@redhat.com>
2642 LWG 3389 and LWG 3390
2643 * include/bits/stl_iterator.h (move_move_iterator): Use std::move when
2644 constructing the move_iterator with __i.
2645 (counted_iterator::counted_iterator): Use std::move when initializing
2647 * testsuite/24_iterators/counted_iterator/lwg3389.cc: New test.
2648 * testsuite/24_iterators/move_iterator/lwg3390.cc: New test.
2650 2020-02-12 Sandra Loosemore <sandra@codesourcery.com>
2655 * configure: Regenerated.
2657 2020-02-12 François Dumont <fdumont@gcc.gnu.org>
2659 * include/bits/hashtable.h
2660 (_Hashtable<>(_Hashtable&&, std::allocator_type&)): Add
2661 missing std namespace qualification to forward call.
2663 2020-02-09 Jonathan Wakely <jwakely@redhat.com>
2665 * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Fix
2667 * testsuite/20_util/function_objects/range.cmp/less.ccL Likewise.
2669 * include/std/ranges: Fix non-ASCII characters in comment.
2671 * include/bits/range_cmp.h (__detail::__eq_builtin_ptr_cmp): Require
2672 equality comparison to be valid and return bool.
2673 (__detail::__less_builtin_ptr_cmp): Likewise for less-than comparison.
2674 * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Check
2675 type with ambiguous conversion to fundamental types.
2676 * testsuite/20_util/function_objects/range.cmp/less.cc: Likewise.
2678 2020-02-07 Jonathan Wakely <jwakely@redhat.com>
2680 * include/bits/iterator_concepts.h (iter_difference_t, iter_value_t):
2682 (readable_traits): Rename to indirectly_readable_traits.
2683 (readable): Rename to indirectly_readable.
2684 (writable): Rename to indirectly_writable.
2685 (__detail::__iter_exchange_move): Do not use remove_reference_t.
2686 (indirectly_swappable): Adjust requires expression parameter types.
2688 * include/bits/ranges_algo.h (ranges::transform, ranges::replace)
2689 (ranges::replace_if, ranges::generate_n, ranges::generate)
2690 (ranges::remove): Use new name for writable.
2691 * include/bits/stl_iterator.h (__detail::__common_iter_has_arrow):
2692 Use new name for readable.
2693 * include/ext/pointer.h (readable_traits<_Pointer_adapter<P>>): Use
2694 new name for readable_traits.
2695 * testsuite/24_iterators/associated_types/readable.traits.cc: Likewise.
2696 * testsuite/24_iterators/indirect_callable/projected.cc: Adjust for
2697 new definition of indirectly_readable.
2699 * include/bits/stl_iterator.h (__detail::__common_iter_ptr): Change
2700 to take parameters of common_iterator, instead of the common_iterator
2701 type itself. Fix argument for __common_iter_has_arrow constraint.
2702 (iterator_traits<common_iterator<I, S>>::pointer): Adjust.
2704 2020-02-07 Jonathan Wakely <jwakely@redhat.com>
2706 * include/std/ranges (iota_view): Add braces to prevent -Wempty-body
2708 (basic_istream_view::_Iterator::operator++()): Add missing return.
2710 2020-02-07 Patrick Palka <ppalka@redhat.com>
2712 * include/bits/ranges_algo.h: Remove extraneous &&.
2714 * include/std/ranges (ranges::__detail::__stream_extractable,
2715 ranges::basic_istream_view, ranges::istream_view): Define.
2716 * testsuite/std/ranges/istream_view: New test.
2718 Implement C++20 range adaptors
2719 * include/std/ranges: Include <bits/refwrap.h> and <tuple>.
2720 (subrange::_S_store_size): Mark as const instead of constexpr to
2721 avoid what seems to be a bug in GCC.
2722 (__detail::__box): Give it defaulted copy and move constructors.
2723 (ranges::views::_Single::operator()): Mark constexpr.
2724 (ranges::views::_Iota::operator()): Mark constexpr.
2725 (__detail::Empty): Define.
2726 (ranges::views::__closure::_RangeAdaptor,
2727 ranges::views::__closure::_RangeAdaptorClosure, ref_view, all_view,
2728 ranges::views::all, ranges::__detail::find_if,
2729 ranges::__detail::find_if_not, ranges::__detail::mismatch,
2730 ranges::detail::min, filter_view, ranges::views::filter, transform_view,
2731 ranges::views::transform, take_view, ranges::views::take,
2732 take_while_view, ranges::views::take_while, drop_view,
2733 ranges::views::drop, join_view, ranges::views::join,
2734 __detail::require_constant, __detail::tiny_range, split_view,
2735 ranges::views::split, ranges::views::_Counted, ranges::views::counted,
2736 common_view, ranges::views::common, reverse_view,
2737 ranges::views::reverse,
2738 ranges::views::__detail::__is_reversible_subrange,
2739 ranges::views::__detail::__is_reverse_view, reverse_view,
2740 ranges::views::reverse, __detail::__has_tuple_element, elements_view,
2741 ranges::views::elements, ranges::views::keys, ranges::views::values):
2743 (views): Alias for ranges::views.
2744 (tuple_size<ranges::subrange<>>, tuple_element<0, ranges::subrange>,
2745 tuple_element<1, ranges::subrange>): New partial specializations.
2746 * testsuite/std/ranges/adaptors/all.cc: New test.
2747 * testsuite/std/ranges/adaptors/common.cc: Likewise.
2748 * testsuite/std/ranges/adaptors/counted.cc: Likewise.
2749 * testsuite/std/ranges/adaptors/drop.cc: Likewise.
2750 * testsuite/std/ranges/adaptors/drop_while.cc: Likewise.
2751 * testsuite/std/ranges/adaptors/elements.cc: Likewise.
2752 * testsuite/std/ranges/adaptors/filter.cc: Likewise.
2753 * testsuite/std/ranges/adaptors/join.cc: Likewise.
2754 * testsuite/std/ranges/adaptors/reverse.cc: Likewise.
2755 * testsuite/std/ranges/adaptors/split.cc: Likewise.
2756 * testsuite/std/ranges/adaptors/take.cc: Likewise.
2757 * testsuite/std/ranges/adaptors/take_while.cc: Likewise.
2758 * testsuite/std/ranges/adaptors/transform.cc: Likewise.
2760 2020-02-07 Jonathan Wakely <jwakely@redhat.com>
2762 * libsupc++/compare (__cmp_cat::type): Define typedef for underlying
2763 type of enumerations and comparison category types.
2764 (__cmp_cat::_Ord, __cmp_cat::_Ncmp): Add underlying type.
2765 (__cmp_cat::_Ncmp::unordered): Change value to 2.
2766 (partial_ordering::_M_value, weak_ordering::_M_value)
2767 (strong_ordering::_M_value): Change type to __cmp_cat::type.
2768 (partial_ordering::_M_is_ordered): Remove data member.
2769 (partial_ordering): Use second bit of _M_value for unordered. Adjust
2770 comparison operators.
2771 (weak_ordering::operator partial_ordering): Simplify to remove
2773 (operator<=>(unspecified, weak_ordering)): Likewise.
2774 (strong_ordering::operator partial_ordering): Likewise.
2775 (strong_ordering::operator weak_ordering): Likewise.
2776 (operator<=>(unspecified, strong_ordering)): Likewise.
2777 * testsuite/18_support/comparisons/categories/partialord.cc: New test.
2778 * testsuite/18_support/comparisons/categories/strongord.cc: New test.
2779 * testsuite/18_support/comparisons/categories/weakord.cc: New test.
2781 * include/std/ranges (iota_view::_Iterator): Fix typo in name of
2782 __cpp_lib_three_way_comparison macro and use deduced return type for
2784 * testsuite/std/ranges/iota/iterator.cc: New test.
2786 2020-02-07 Patrick Palka <ppalka@redhat.com>
2787 Jonathan Wakely <jwakely@redhat.com>
2789 Implement C++20 constrained algorithms
2790 * include/Makefile.am: Add new header.
2791 * include/Makefile.in: Regenerate.
2792 * include/std/algorithm: Include <bits/ranges_algo.h>.
2793 * include/bits/ranges_algo.h: New file.
2794 * testsuite/25_algorithms/adjacent_find/constrained.cc: New test.
2795 * testsuite/25_algorithms/all_of/constrained.cc: New test.
2796 * testsuite/25_algorithms/any_of/constrained.cc: New test.
2797 * testsuite/25_algorithms/binary_search/constrained.cc: New test.
2798 * testsuite/25_algorithms/copy/constrained.cc: New test.
2799 * testsuite/25_algorithms/copy_backward/constrained.cc: New test.
2800 * testsuite/25_algorithms/copy_if/constrained.cc: New test.
2801 * testsuite/25_algorithms/copy_n/constrained.cc: New test.
2802 * testsuite/25_algorithms/count/constrained.cc: New test.
2803 * testsuite/25_algorithms/count_if/constrained.cc: New test.
2804 * testsuite/25_algorithms/equal/constrained.cc: New test.
2805 * testsuite/25_algorithms/equal_range/constrained.cc: New test.
2806 * testsuite/25_algorithms/fill/constrained.cc: New test.
2807 * testsuite/25_algorithms/fill_n/constrained.cc: New test.
2808 * testsuite/25_algorithms/find/constrained.cc: New test.
2809 * testsuite/25_algorithms/find_end/constrained.cc: New test.
2810 * testsuite/25_algorithms/find_first_of/constrained.cc: New test.
2811 * testsuite/25_algorithms/find_if/constrained.cc: New test.
2812 * testsuite/25_algorithms/find_if_not/constrained.cc: New test.
2813 * testsuite/25_algorithms/for_each/constrained.cc: New test.
2814 * testsuite/25_algorithms/generate/constrained.cc: New test.
2815 * testsuite/25_algorithms/generate_n/constrained.cc: New test.
2816 * testsuite/25_algorithms/heap/constrained.cc: New test.
2817 * testsuite/25_algorithms/includes/constrained.cc: New test.
2818 * testsuite/25_algorithms/inplace_merge/constrained.cc: New test.
2819 * testsuite/25_algorithms/is_partitioned/constrained.cc: New test.
2820 * testsuite/25_algorithms/is_permutation/constrained.cc: New test.
2821 * testsuite/25_algorithms/is_sorted/constrained.cc: New test.
2822 * testsuite/25_algorithms/is_sorted_until/constrained.cc: New test.
2823 * testsuite/25_algorithms/lexicographical_compare/constrained.cc: New
2825 * testsuite/25_algorithms/lower_bound/constrained.cc: New test.
2826 * testsuite/25_algorithms/max/constrained.cc: New test.
2827 * testsuite/25_algorithms/max_element/constrained.cc: New test.
2828 * testsuite/25_algorithms/merge/constrained.cc: New test.
2829 * testsuite/25_algorithms/min/constrained.cc: New test.
2830 * testsuite/25_algorithms/min_element/constrained.cc: New test.
2831 * testsuite/25_algorithms/minmax/constrained.cc: New test.
2832 * testsuite/25_algorithms/minmax_element/constrained.cc: New test.
2833 * testsuite/25_algorithms/mismatch/constrained.cc: New test.
2834 * testsuite/25_algorithms/move/constrained.cc: New test.
2835 * testsuite/25_algorithms/move_backward/constrained.cc: New test.
2836 * testsuite/25_algorithms/next_permutation/constrained.cc: New test.
2837 * testsuite/25_algorithms/none_of/constrained.cc: New test.
2838 * testsuite/25_algorithms/nth_element/constrained.cc: New test.
2839 * testsuite/25_algorithms/partial_sort/constrained.cc: New test.
2840 * testsuite/25_algorithms/partial_sort_copy/constrained.cc: New test.
2841 * testsuite/25_algorithms/partition/constrained.cc: New test.
2842 * testsuite/25_algorithms/partition_copy/constrained.cc: New test.
2843 * testsuite/25_algorithms/partition_point/constrained.cc: New test.
2844 * testsuite/25_algorithms/prev_permutation/constrained.cc: New test.
2845 * testsuite/25_algorithms/remove/constrained.cc: New test.
2846 * testsuite/25_algorithms/remove_copy/constrained.cc: New test.
2847 * testsuite/25_algorithms/remove_copy_if/constrained.cc: New test.
2848 * testsuite/25_algorithms/remove_if/constrained.cc: New test.
2849 * testsuite/25_algorithms/replace/constrained.cc: New test.
2850 * testsuite/25_algorithms/replace_copy/constrained.cc: New test.
2851 * testsuite/25_algorithms/replace_copy_if/constrained.cc: New test.
2852 * testsuite/25_algorithms/replace_if/constrained.cc: New test.
2853 * testsuite/25_algorithms/reverse/constrained.cc: New test.
2854 * testsuite/25_algorithms/reverse_copy/constrained.cc: New test.
2855 * testsuite/25_algorithms/rotate/constrained.cc: New test.
2856 * testsuite/25_algorithms/rotate_copy/constrained.cc: New test.
2857 * testsuite/25_algorithms/search/constrained.cc: New test.
2858 * testsuite/25_algorithms/search_n/constrained.cc: New test.
2859 * testsuite/25_algorithms/set_difference/constrained.cc: New test.
2860 * testsuite/25_algorithms/set_intersection/constrained.cc: New test.
2861 * testsuite/25_algorithms/set_symmetric_difference/constrained.cc: New
2863 * testsuite/25_algorithms/set_union/constrained.cc: New test.
2864 * testsuite/25_algorithms/shuffle/constrained.cc: New test.
2865 * testsuite/25_algorithms/sort/constrained.cc: New test.
2866 * testsuite/25_algorithms/stable_partition/constrained.cc: New test.
2867 * testsuite/25_algorithms/stable_sort/constrained.cc: New test.
2868 * testsuite/25_algorithms/swap_ranges/constrained.cc: New test.
2869 * testsuite/25_algorithms/transform/constrained.cc: New test.
2870 * testsuite/25_algorithms/unique/constrained.cc: New test.
2871 * testsuite/25_algorithms/unique_copy/constrained.cc: New test.
2872 * testsuite/25_algorithms/upper_bound/constrained.cc: New test.
2874 2020-02-06 Jonathan Wakely <jwakely@redhat.com>
2876 * include/bits/stl_iterator.h (__detail::__common_iter_ptr): Fix PR
2877 number in comment. Fix indentation.
2879 * include/bits/stl_algobase.h (__iter_swap, __iter_swap<true>): Remove
2880 redundant _GLIBCXX20_CONSTEXPR.
2882 * include/std/ranges (viewable_range): Replace decay_t with
2883 remove_cvref_t (LWG 3375).
2885 2020-02-05 Jonathan Wakely <jwakely@redhat.com>
2887 * include/bits/iterator_concepts.h (iter_reference_t)
2888 (iter_rvalue_reference_t, iter_common_reference_t, indirect_result_t):
2889 Remove workarounds for PR c++/67704.
2890 * testsuite/24_iterators/aliases.cc: New test.
2892 2020-02-05 Patrick Palka <ppalka@redhat.com>
2894 * include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i
2895 when initializing _M_current.
2896 (move_iterator::base): Split into two overloads differing in
2897 ref-qualifiers as in P1207R4 for C++20.
2899 2020-02-04 Jonathan Wakely <jwakely@redhat.com>
2901 * include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
2905 * include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
2906 (unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
2907 * testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
2909 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
2911 * configure: Regenerate.
2913 2020-01-31 Patrick Palka <ppalka@redhat.com>
2915 * testsuite/24_iterators/range_operations/distance.cc: Do not assume
2916 test_range::end() returns the same type as test_range::begin().
2917 * testsuite/24_iterators/range_operations/next.cc: Likewise.
2918 * testsuite/24_iterators/range_operations/prev.cc: Likewise.
2919 * testsuite/util/testsuite_iterators.h (__gnu_test::test_range::end):
2920 Always return a sentinel<I>.
2922 2020-01-29 Jonathan Wakely <jwakely@redhat.com>
2925 * include/std/stop_token (stop_token::stop_possible()): Call new
2926 _M_stop_possible() function.
2927 (stop_token::stop_requested()): Do not use stop_possible().
2928 (stop_token::binary_semaphore): New class, as temporary stand-in for
2929 std::binary_semaphore.
2930 (stop_token::_Stop_cb::_M_callback): Add noexcept to type.
2931 (stop_token::_Stop_cb::_M_destroyed, stop_token::_Stop_cb::_M_done):
2932 New data members for symchronization with stop_callback destruction.
2933 (stop_token::_Stop_cb::_Stop_cb): Make non-template.
2934 (stop_token::_Stop_cb::_M_linked, stop_token::_Stop_cb::_S_execute):
2936 (stop_token::_Stop_cb::_M_run): New member function.
2937 (stop_token::_Stop_state::_M_stopped, stop_token::_Stop_state::_M_mtx):
2939 (stop_token::_Stop_state::_M_owners): New data member to track
2940 reference count for ownership.
2941 (stop_token::_Stop_state::_M_value): New data member combining a
2942 spinlock, the stop requested flag, and the reference count for
2943 associated stop_source objects.
2944 (stop_token::_Stop_state::_M_requester): New data member for
2945 synchronization with stop_callback destruction.
2946 (stop_token::_Stop_state::_M_stop_possible()): New member function.
2947 (stop_token::_Stop_state::_M_stop_requested()): Inspect relevant bit
2949 (stop_token::_Stop_state::_M_add_owner)
2950 (stop_token::_Stop_state::_M_release_ownership)
2951 (stop_token::_Stop_state::_M_add_ssrc)
2952 (stop_token::_Stop_state::_M_sub_ssrc): New member functions for
2953 updating reference counts.
2954 (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
2955 (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
2956 (stop_token::_Stop_state::_M_try_lock)
2957 (stop_token::_Stop_state::_M_try_lock_and_stop)
2958 (stop_token::_Stop_state::_M_do_try_lock): New member functions for
2960 (stop_token::_Stop_state::_M_request_stop): Use atomic operations to
2961 read and update state. Release lock while running callbacks. Use new
2962 data members to synchronize with callback destruction.
2963 (stop_token::_Stop_state::_M_remove_callback): Likewise.
2964 (stop_token::_Stop_state::_M_register_callback): Use atomic operations
2965 to read and update state.
2966 (stop_token::_Stop_state_ref): Handle type to manage _Stop_state,
2967 replacing shared_ptr.
2968 (stop_source::stop_source(const stop_source&)): Update reference count.
2969 (stop_source::operator=(const stop_source&)): Likewise.
2970 (stop_source::~stop_source()): Likewise.
2971 (stop_source::stop_source(stop_source&&)): Define as defaulted.
2972 (stop_source::operator=(stop_source&&)): Establish postcondition on
2974 (stop_callback): Enforce preconditions on template parameter. Replace
2975 base class with data member of new _Cb_impl type.
2976 (stop_callback::stop_callback(const stop_token&, Cb&&))
2977 (stop_callback::stop_callback(stop_token&&, Cb&&)): Fix TOCTTOU race.
2978 (stop_callback::_Cb_impl): New type wrapping _Callback member and
2979 defining the _S_execute member function.
2980 * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc: New
2982 * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: New test.
2983 * testsuite/30_threads/stop_token/stop_callback/destroy.cc: New test.
2984 * testsuite/30_threads/stop_token/stop_callback/destructible_neg.cc:
2986 * testsuite/30_threads/stop_token/stop_callback/invocable_neg.cc: New
2988 * testsuite/30_threads/stop_token/stop_callback/invoke.cc: New test.
2989 * testsuite/30_threads/stop_token/stop_source/assign.cc: New test.
2990 * testsuite/30_threads/stop_token/stop_token/stop_possible.cc: New
2993 * libsupc++/compare (__detail::__3way_builtin_ptr_cmp): Use
2994 three_way_comparable_with.
2995 (__detail::__3way_cmp_with): Remove workaround for fixed bug.
2996 (compare_three_way::operator()): Remove redundant constraint from
2998 (__detail::_Synth3way::operator()): Use three_way_comparable_with
2999 instead of workaround.
3000 * testsuite/18_support/comparisons/object/93479.cc: Prune extra
3001 output due to simplified constraints on compare_three_way::operator().
3004 * libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid.
3005 * testsuite/18_support/comparisons/object/93479.cc: New test.
3007 * testsuite/std/ranges/access/end.cc: Do not assume test_range::end()
3008 returns the same type as test_range::begin(). Add comments.
3009 * testsuite/std/ranges/access/rbegin.cc: Likewise.
3010 * testsuite/std/ranges/access/rend.cc: Likewise.
3011 * testsuite/std/ranges/range.cc: Do not assume the sentinel for
3012 test_range is the same as its iterator type.
3013 * testsuite/util/testsuite_iterators.h (test_range::sentinel): Add
3014 operator- overloads to satisfy sized_sentinel_for when the iterator
3015 satisfies random_access_iterator.
3017 2020-01-28 Jonathan Wakely <jwakely@redhat.com>
3020 * include/bits/refwrap.h (reference_wrapper::operator()): Restrict
3021 static assertion to object types.
3024 * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
3025 clock_gettime instead of explicit glibc version check.
3026 * configure: Regenerate.
3028 2020-01-28 Martin Liska <mliska@suse.cz>
3031 * include/std/atomic: Fix typo.
3032 * include/std/optional: Likewise.
3034 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com>
3036 * configure: Regenerate.
3038 2020-01-27 Jonathan Wakely <jwakely@redhat.com>
3041 * include/std/span (span): Fix deduction guide.
3042 * testsuite/23_containers/span/deduction.cc: New test.
3044 2020-01-24 Jonathan Wakely <jwakely@redhat.com>
3046 * libsupc++/compare (__cmp_cat::_Eq): Remove enumeration type.
3047 (__cmp_cat::_Ord::equivalent): Add enumerator.
3048 (__cmp_cat::_Ord::_Less, __cmp_cat::_Ord::_Greater): Rename to less
3050 (partial_ordering, weak_ordering, strong_ordering): Remove
3051 constructors taking __cmp_cat::_Eq parameters. Use renamed
3054 2020-01-24 Maciej W. Rozycki <macro@wdc.com>
3056 * acinclude.m4: Handle `--with-toolexeclibdir='.
3057 * Makefile.in: Regenerate.
3058 * aclocal.m4: Regenerate.
3059 * configure: Regenerate.
3060 * doc/Makefile.in: Regenerate.
3061 * include/Makefile.in: Regenerate.
3062 * libsupc++/Makefile.in: Regenerate.
3063 * po/Makefile.in: Regenerate.
3064 * python/Makefile.in: Regenerate.
3065 * src/Makefile.in: Regenerate.
3066 * src/c++11/Makefile.in: Regenerate.
3067 * src/c++17/Makefile.in: Regenerate.
3068 * src/c++98/Makefile.in: Regenerate.
3069 * src/filesystem/Makefile.in: Regenerate.
3070 * testsuite/Makefile.in: Regenerate.
3072 2020-01-23 Alexandre Oliva <oliva@adacore.com>
3074 * crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Reject macros.
3075 * configure: Rebuild.
3077 * testsuite/27_io/fpos/mbstate_t/1.cc: Zero-init mbstate_t.
3079 2020-01-23 Jonathan Wakely <jwakely@redhat.com>
3082 * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
3084 * include/Makefile.in: Regenerate.
3086 2020-01-20 Jonathan Wakely <jwakely@redhat.com>
3088 * doc/xml/faq.xml: Fix grammar.
3089 * doc/xml/manual/appendix_contributing.xml: Improve instructions.
3090 * doc/xml/manual/spine.xml: Update copyright years.
3091 * doc/html/*: Regenerate.
3093 2020-01-19 Eric S. Raymond <esr@thyrsus.com>
3095 * doc/xml/faq.xml: Update for SVN -> Git transition.
3096 * doc/xml/manual/appendix_contributing.xml: Likewise.
3097 * doc/xml/manual/status_cxx1998.xml: Likewise.
3098 * doc/xml/manual/status_cxx2011.xml: Likewise.
3099 * doc/xml/manual/status_cxx2014.xml: Likewise.
3100 * doc/xml/manual/status_cxx2017.xml: Likewise.
3101 * doc/xml/manual/status_cxx2020.xml: Likewise.
3102 * doc/xml/manual/status_cxxtr1.xml: Likewise.
3103 * doc/xml/manual/status_cxxtr24733.xml: Likewise.
3105 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
3107 * include/Makefile.am: Add coroutine to the std set.
3108 * include/Makefile.in: Regenerated.
3109 * include/std/coroutine: New file.
3111 2020-01-17 Jonathan Wakely <jwakely@redhat.com>
3114 * include/bits/c++config: Only do PSTL config when the header is
3115 present, to fix freestanding.
3116 * libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
3117 functions if they were detected by configure.
3119 2020-01-16 Kai-Uwe Eckhardt <kuehro@gmx.de>
3120 Matthew Bauer <mjbauer95@gmail.com>
3121 Jonathan Wakely <jwakely@redhat.com>
3123 PR bootstrap/64271 (partial)
3124 * config/os/bsd/netbsd/ctype_base.h (ctype_base::mask): Change type
3126 (ctype_base::alpha, ctype_base::digit, ctype_base::xdigit)
3127 (ctype_base::print, ctype_base::graph, ctype_base::alnum): Sync
3128 definitions with NetBSD upstream.
3129 (ctype_base::blank): Use _CTYPE_BL.
3130 * config/os/bsd/netbsd/ctype_configure_char.cc (_C_ctype_): Remove
3132 (ctype<char>::classic_table): Use _C_ctype_tab_ instead of _C_ctype_.
3133 (ctype<char>::do_toupper, ctype<char>::do_tolower): Cast char
3134 parameters to unsigned char.
3135 * config/os/bsd/netbsd/ctype_inline.h (ctype<char>::is): Likewise.
3137 2020-01-16 François Dumont <fdumont@gcc.gnu.org>
3140 * include/bits/hashtable.h (_Hashtable<>): Make _Equality<> friend.
3141 * include/bits/hashtable_policy.h: Include <bits/stl_algo.h>.
3142 (_Equality_base): Remove.
3143 (_Equality<>::_M_equal): Review implementation. Use
3144 std::is_permutation.
3145 * testsuite/23_containers/unordered_multiset/operators/1.cc
3146 (Hash, Equal, test02, test03): New.
3147 * testsuite/23_containers/unordered_set/operators/1.cc
3148 (Hash, Equal, test02, test03): New.
3150 2020-01-15 Jonathan Wakely <jwakely@redhat.com>
3153 * include/bits/iterator_concepts.h (__max_diff_type, __max_size_type):
3154 Move here from <bits/range_access.h> and define using __int128 when
3156 (__is_integer_like, __is_signed_integer_like): Move here from
3157 <bits/range_access.h>.
3158 (weakly_incrementable): Use __is_signed_integer_like.
3159 * include/bits/range_access.h (__max_diff_type, __max_size_type)
3160 (__is_integer_like, __is_signed_integer_like): Move to
3161 <bits/iterator_concepts.h>.
3162 (__make_unsigned_like_t): Move here from <ranges>.
3163 * include/std/ranges (__make_unsigned_like_t): Move to
3164 <bits/range_access.h>.
3165 (iota_view): Replace using-directive with using-declarations.
3166 * testsuite/std/ranges/iota/93267.cc: New test.
3167 * testsuite/std/ranges/iota_view.cc: Move to new 'iota' sub-directory.
3169 2020-01-13 Jonathan Wakely <jwakely@redhat.com>
3172 * include/bits/fs_path.h (path::generic_string<C,A>)
3173 [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
3174 * testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
3175 root-dir is converted to forward slash in generic pathname.
3176 * testsuite/27_io/filesystem/path/generic/utf.cc: New test.
3177 * testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.
3180 * include/bits/atomic_base.h (__cpp_lib_atomic_value_initialization):
3182 (__atomic_flag_base, __atomic_base, __atomic_base<_PTp*>)
3183 (__atomic_float): Add default member initializer for C++20.
3184 * include/std/atomic (atomic): Likewise.
3185 (atomic::atomic()): Remove noexcept-specifier on default constructor.
3186 * include/std/version (__cpp_lib_atomic_value_initialization): Define.
3187 * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error line
3189 * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
3190 * testsuite/29_atomics/atomic/cons/value_init.cc: New test.
3191 * testsuite/29_atomics/atomic_flag/cons/value_init.cc: New test.
3192 * testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Adjust
3193 expected result for is_trivially_default_constructible.
3194 * testsuite/29_atomics/atomic_float/requirements.cc: Likewise.
3195 * testsuite/29_atomics/atomic_float/value_init.cc: New test.
3196 * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise.
3197 * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
3198 * testsuite/29_atomics/atomic_integral/cons/value_init.cc
3199 * testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Adjust
3200 expected results for is_trivially_default_constructible.
3201 * testsuite/util/testsuite_common_types.h (has_trivial_dtor): Add
3204 2020-01-10 Jonathan Wakely <jwakely@redhat.com>
3206 * testsuite/util/testsuite_iterators.h: Improve comment.
3208 * testsuite/25_algorithms/equal/deque_iterators/1.cc: Don't use C++11
3209 initialization syntax.
3212 * include/bits/streambuf_iterator.h (istreambuf_iterator): Make type
3213 of base class independent of __cplusplus value.
3214 [__cplusplus < 201103L] (istreambuf_iterator::reference): Override the
3215 type defined in the base class
3216 * testsuite/24_iterators/istreambuf_iterator/92285.cc: New test.
3217 * testsuite/24_iterators/istreambuf_iterator/requirements/
3218 base_classes.cc: Adjust expected base class for C++98.
3220 2020-01-09 Olivier Hainque <hainque@adacore.com>
3222 * doc/xml/manual/appendix_contributing.xml: Document _C2
3223 as a reserved identifier, by VxWorks.
3224 * include/bits/stl_map.h: Rename _C2 template typenames as _Cmp2.
3225 * include/bits/stl_multimap.h: Likewise.
3227 2020-01-09 Jonathan Wakely <jwakely@redhat.com>
3229 * include/ext/extptr_allocator.h (_ExtPtr_allocator::operator==)
3230 (_ExtPtr_allocator::operator!=): Add missing const qualifiers.
3231 * include/ext/pointer.h (readable_traits<_Pointer_adapter<S>>): Add
3232 partial specialization to disambiguate the two constrained
3235 * include/experimental/type_traits (experimental::is_pod_v): Disable
3236 -Wdeprecated-declarations warnings around reference to std::is_pod.
3237 * include/std/type_traits (is_pod_v): Likewise.
3238 * testsuite/18_support/max_align_t/requirements/2.cc: Also check
3239 is_standard_layout and is_trivial. Do not check is_pod for C++20.
3240 * testsuite/20_util/is_pod/requirements/explicit_instantiation.cc:
3241 Add -Wno-deprecated for C++20.
3242 * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
3243 * testsuite/20_util/is_pod/value.cc: Likewise.
3244 * testsuite/experimental/type_traits/value.cc: Likewise.
3246 2020-01-09 JeanHeyd "ThePhD" Meneide <phdofthehouse@gmail.com>
3248 * include/bits/c++config (_GLIBCXX20_DEPRECATED): Add new macro.
3249 * include/std/type_traits (is_pod, is_pod_v): Deprecate for C++20.
3250 * testuite/20_util/is_pod/deprecated-2a.cc: New test.
3252 2020-01-09 Jonathan Wakely <jwakely@redhat.com>
3255 * include/bits/random.h (operator>>): Check stream operation succeeds.
3256 * include/bits/random.tcc (operator<<): Remove redundant __ostream_type
3258 (operator>>): Remove redundant __istream_type typedefs. Check stream
3260 (__extract_params): New function to fill a vector from a stream.
3261 * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.
3264 * config/abi/pre/gnu.ver: Add new exports.
3265 * include/std/memory_resource (memory_resource::~memory_resource()):
3266 Do not define inline.
3267 (monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
3268 * src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
3270 (monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
3271 * testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.
3273 2020-01-09 François Dumont <fdumont@gcc.gnu.org>
3276 * include/bits/hashtable.h (_Hashtable<>::__alloc_node_gen_t): New
3278 (_Hashtable<>::__fwd_value_for): New.
3279 (_Hashtable<>::_M_assign_elements<>): Remove _NodeGenerator template
3281 (_Hashtable<>::_M_assign<>): Add _Ht template parameter.
3282 (_Hashtable<>::operator=(const _Hashtable<>&)): Adapt.
3283 (_Hashtable<>::_M_move_assign): Adapt. Replace std::move_if_noexcept
3285 (_Hashtable<>::_Hashtable(const _Hashtable&)): Adapt.
3286 (_Hashtable<>::_Hashtable(const _Hashtable&, const allocator_type&)):
3288 (_Hashtable<>::_Hashtable(_Hashtable&&, const allocator_type&)):
3290 * testsuite/23_containers/unordered_set/92124.cc: New.
3292 2020-01-08 Jonathan Wakely <jwakely@redhat.com>
3295 * src/c++17/fs_ops.cc (do_remove_all): New function implementing more
3296 detailed error reporting for remove_all. Check result of recursive
3297 call before incrementing iterator.
3298 (remove_all(const path&), remove_all(const path&, error_code&)): Use
3300 * src/filesystem/ops.cc (remove_all(const path&, error_code&)): Check
3301 result of recursive call before incrementing iterator.
3302 * testsuite/27_io/filesystem/operations/remove_all.cc: Check errors
3303 are reported correctly.
3304 * testsuite/experimental/filesystem/operations/remove_all.cc: Likewise.
3306 2020-01-07 Thomas Rodgers <trodgers@redhat.com>
3308 * include/std/condition_variable
3309 (condition_variable_any::wait_on): Rename to match current draft
3311 (condition_variable_any::wait_on_until): Likewise.
3312 (condition_variable_any::wait_on_for): Likewise.
3313 * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
3314 Adjust tests to account for renamed methods.
3316 2020-01-07 François Dumont <fdumont@gcc.gnu.org>
3319 * include/bits/stl_tree.h
3320 (_Rb_tree<>::_M_move_assign(_Rb_tree&, false_type)): Replace
3321 std::move_if_noexcept by std::move.
3322 * testsuite/23_containers/map/92124.cc: New.
3323 * testsuite/23_containers/set/92124.cc: New.
3325 2020-01-06 Jonathan Wakely <jwakely@redhat.com>
3327 * include/std/stop_token (stop_token): Remove operator!= (LWG 3254).
3328 (stop_source): Likewise (LWG 3362).
3329 * testsuite/30_threads/stop_token/stop_source.cc: Test equality
3332 * include/bits/stl_algobase.h (__is_byte_iter, __min_cmp)
3333 (lexicographical_compare_three_way): Do not depend on
3335 * include/std/version (__cpp_lib_three_way_comparison): Only define
3336 when __cpp_lib_concepts is defined.
3337 * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise.
3339 2020-01-03 Jonathan Wakely <jwakely@redhat.com>
3341 * include/bits/stl_algobase.h (lexicographical_compare_three_way):
3342 Only define four-argument overload when __cpp_lib_concepts is defined.
3344 2020-01-01 John David Anglin <danglin@gcc.gnu.org>
3346 * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
3348 2020-01-01 Jakub Jelinek <jakub@redhat.com>
3350 Update copyright years.
3352 Copyright (C) 2020 Free Software Foundation, Inc.
3354 Copying and distribution of this file, with or without modification,
3355 are permitted in any medium without royalty provided the copyright
3356 notice and this notice are preserved.