Fix PR 93568 (thinko)
[official-gcc.git] / libstdc++-v3 / ChangeLog
blob76a6e2b542de2d9059189f6f35360fb7395724bd
1 2020-02-05  Jonathan Wakely  <jwakely@redhat.com>
3         * include/bits/iterator_concepts.h (iter_reference_t)
4         (iter_rvalue_reference_t, iter_common_reference_t, indirect_result_t):
5         Remove workarounds for PR c++/67704.
6         * testsuite/24_iterators/aliases.cc: New test.
8 2020-02-05  Patrick Palka  <ppalka@redhat.com>
10         * include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i
11         when initializing _M_current.
12         (move_iterator::base): Split into two overloads differing in
13         ref-qualifiers as in P1207R4 for C++20.
15 2020-02-04  Jonathan Wakely  <jwakely@redhat.com>
17         * include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
18         use.
20         PR libstdc++/93562
21         * include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
22         (unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
23         * testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
25 2020-02-01  Andrew Burgess  <andrew.burgess@embecosm.com>
27         * configure: Regenerate.
29 2020-01-31  Patrick Palka  <ppalka@redhat.com>
31         * testsuite/24_iterators/range_operations/distance.cc: Do not assume
32         test_range::end() returns the same type as test_range::begin().
33         * testsuite/24_iterators/range_operations/next.cc: Likewise.
34         * testsuite/24_iterators/range_operations/prev.cc: Likewise.
35         * testsuite/util/testsuite_iterators.h (__gnu_test::test_range::end):
36         Always return a sentinel<I>.
38 2020-01-29  Jonathan Wakely  <jwakely@redhat.com>
40         PR libstdc++/92895
41         * include/std/stop_token (stop_token::stop_possible()): Call new
42         _M_stop_possible() function.
43         (stop_token::stop_requested()): Do not use stop_possible().
44         (stop_token::binary_semaphore): New class, as temporary stand-in for
45         std::binary_semaphore.
46         (stop_token::_Stop_cb::_M_callback): Add noexcept to type.
47         (stop_token::_Stop_cb::_M_destroyed, stop_token::_Stop_cb::_M_done):
48         New data members for symchronization with stop_callback destruction.
49         (stop_token::_Stop_cb::_Stop_cb): Make non-template.
50         (stop_token::_Stop_cb::_M_linked, stop_token::_Stop_cb::_S_execute):
51         Remove.
52         (stop_token::_Stop_cb::_M_run): New member function.
53         (stop_token::_Stop_state::_M_stopped, stop_token::_Stop_state::_M_mtx):
54         Remove.
55         (stop_token::_Stop_state::_M_owners): New data member to track
56         reference count for ownership.
57         (stop_token::_Stop_state::_M_value): New data member combining a
58         spinlock, the stop requested flag, and the reference count for
59         associated stop_source objects.
60         (stop_token::_Stop_state::_M_requester): New data member for
61         synchronization with stop_callback destruction.
62         (stop_token::_Stop_state::_M_stop_possible()): New member function.
63         (stop_token::_Stop_state::_M_stop_requested()): Inspect relevant bit
64         of _M_value.
65         (stop_token::_Stop_state::_M_add_owner)
66         (stop_token::_Stop_state::_M_release_ownership)
67         (stop_token::_Stop_state::_M_add_ssrc)
68         (stop_token::_Stop_state::_M_sub_ssrc): New member functions for
69         updating reference counts.
70         (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
71         (stop_token::_Stop_state::_M_lock, stop_token::_Stop_state::_M_unlock)
72         (stop_token::_Stop_state::_M_try_lock)
73         (stop_token::_Stop_state::_M_try_lock_and_stop)
74         (stop_token::_Stop_state::_M_do_try_lock): New member functions for
75         managing spinlock.
76         (stop_token::_Stop_state::_M_request_stop): Use atomic operations to
77         read and update state. Release lock while running callbacks. Use new
78         data members to synchronize with callback destruction.
79         (stop_token::_Stop_state::_M_remove_callback): Likewise.
80         (stop_token::_Stop_state::_M_register_callback): Use atomic operations
81         to read and update state.
82         (stop_token::_Stop_state_ref): Handle type to manage _Stop_state,
83         replacing shared_ptr.
84         (stop_source::stop_source(const stop_source&)): Update reference count.
85         (stop_source::operator=(const stop_source&)): Likewise.
86         (stop_source::~stop_source()): Likewise.
87         (stop_source::stop_source(stop_source&&)): Define as defaulted.
88         (stop_source::operator=(stop_source&&)): Establish postcondition on
89         parameter.
90         (stop_callback): Enforce preconditions on template parameter. Replace
91         base class with data member of new _Cb_impl type.
92         (stop_callback::stop_callback(const stop_token&, Cb&&))
93         (stop_callback::stop_callback(stop_token&&, Cb&&)): Fix TOCTTOU race.
94         (stop_callback::_Cb_impl): New type wrapping _Callback member and
95         defining the _S_execute member function.
96         * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc: New
97         test.
98         * testsuite/30_threads/stop_token/stop_callback/deadlock.cc: New test.
99         * testsuite/30_threads/stop_token/stop_callback/destroy.cc: New test.
100         * testsuite/30_threads/stop_token/stop_callback/destructible_neg.cc:
101         New test.
102         * testsuite/30_threads/stop_token/stop_callback/invocable_neg.cc: New
103         test.
104         * testsuite/30_threads/stop_token/stop_callback/invoke.cc: New test.
105         * testsuite/30_threads/stop_token/stop_source/assign.cc: New test.
106         * testsuite/30_threads/stop_token/stop_token/stop_possible.cc: New
107         test.
109         * libsupc++/compare (__detail::__3way_builtin_ptr_cmp): Use
110         three_way_comparable_with.
111         (__detail::__3way_cmp_with): Remove workaround for fixed bug.
112         (compare_three_way::operator()): Remove redundant constraint from
113         requires-clause.
114         (__detail::_Synth3way::operator()): Use three_way_comparable_with
115         instead of workaround.
116         * testsuite/18_support/comparisons/object/93479.cc: Prune extra
117         output due to simplified constraints on compare_three_way::operator().
119         PR libstdc++/93479
120         * libsupc++/compare (__3way_builtin_ptr_cmp): Require <=> to be valid.
121         * testsuite/18_support/comparisons/object/93479.cc: New test.
123         * testsuite/std/ranges/access/end.cc: Do not assume test_range::end()
124         returns the same type as test_range::begin(). Add comments.
125         * testsuite/std/ranges/access/rbegin.cc: Likewise.
126         * testsuite/std/ranges/access/rend.cc: Likewise.
127         * testsuite/std/ranges/range.cc: Do not assume the sentinel for
128         test_range is the same as its iterator type.
129         * testsuite/util/testsuite_iterators.h (test_range::sentinel): Add
130         operator- overloads to satisfy sized_sentinel_for when the iterator
131         satisfies random_access_iterator.
133 2020-01-28  Jonathan Wakely  <jwakely@redhat.com>
135         PR libstdc++/93470
136         * include/bits/refwrap.h (reference_wrapper::operator()): Restrict
137         static assertion to object types.
139         PR libstdc++/93325
140         * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
141         clock_gettime instead of explicit glibc version check.
142         * configure: Regenerate.
144 2020-01-28  Martin Liska  <mliska@suse.cz>
146         PR libstdc++/93478
147         * include/std/atomic: Fix typo.
148         * include/std/optional: Likewise.
150 2020-01-27  Andrew Burgess  <andrew.burgess@embecosm.com>
152         * configure: Regenerate.
154 2020-01-27  Jonathan Wakely  <jwakely@redhat.com>
156         PR libstdc++/93426
157         * include/std/span (span): Fix deduction guide.
158         * testsuite/23_containers/span/deduction.cc: New test.
160 2020-01-24  Jonathan Wakely  <jwakely@redhat.com>
162         * libsupc++/compare (__cmp_cat::_Eq): Remove enumeration type.
163         (__cmp_cat::_Ord::equivalent): Add enumerator.
164         (__cmp_cat::_Ord::_Less, __cmp_cat::_Ord::_Greater): Rename to less
165         and greater.
166         (partial_ordering, weak_ordering, strong_ordering): Remove
167         constructors taking __cmp_cat::_Eq parameters. Use renamed
168         enumerators.
170 2020-01-24  Maciej W. Rozycki  <macro@wdc.com>
172         * acinclude.m4: Handle `--with-toolexeclibdir='.
173         * Makefile.in: Regenerate.
174         * aclocal.m4: Regenerate.
175         * configure: Regenerate.
176         * doc/Makefile.in: Regenerate.
177         * include/Makefile.in: Regenerate.
178         * libsupc++/Makefile.in: Regenerate.
179         * po/Makefile.in: Regenerate.
180         * python/Makefile.in: Regenerate.
181         * src/Makefile.in: Regenerate.
182         * src/c++11/Makefile.in: Regenerate.
183         * src/c++17/Makefile.in: Regenerate.
184         * src/c++98/Makefile.in: Regenerate.
185         * src/filesystem/Makefile.in: Regenerate.
186         * testsuite/Makefile.in: Regenerate.
188 2020-01-23  Alexandre Oliva <oliva@adacore.com>
190         * crossconfig.m4 (GLIBCXX_CHECK_MATH_DECL): Reject macros.
191         * configure: Rebuild.
193         * testsuite/27_io/fpos/mbstate_t/1.cc: Zero-init mbstate_t.
195 2020-01-23  Jonathan Wakely  <jwakely@redhat.com>
197         PR libstdc++/91947
198         * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
199         rule.
200         * include/Makefile.in: Regenerate.
202 2020-01-20  Jonathan Wakely  <jwakely@redhat.com>
204         * doc/xml/faq.xml: Fix grammar.
205         * doc/xml/manual/appendix_contributing.xml: Improve instructions.
206         * doc/xml/manual/spine.xml: Update copyright years.
207         * doc/html/*: Regenerate.
209 2020-01-19  Eric S. Raymond <esr@thyrsus.com>
211         * doc/xml/faq.xml: Update for SVN -> Git transition.
212         * doc/xml/manual/appendix_contributing.xml: Likewise.
213         * doc/xml/manual/status_cxx1998.xml: Likewise.
214         * doc/xml/manual/status_cxx2011.xml: Likewise.
215         * doc/xml/manual/status_cxx2014.xml: Likewise.
216         * doc/xml/manual/status_cxx2017.xml: Likewise.
217         * doc/xml/manual/status_cxx2020.xml: Likewise.
218         * doc/xml/manual/status_cxxtr1.xml: Likewise.
219         * doc/xml/manual/status_cxxtr24733.xml: Likewise.
221 2020-01-18  Iain Sandoe  <iain@sandoe.co.uk>
223         * include/Makefile.am: Add coroutine to the std set.
224         * include/Makefile.in: Regenerated.
225         * include/std/coroutine: New file.
227 2020-01-17  Jonathan Wakely  <jwakely@redhat.com>
229         PR libstdc++/92376
230         * include/bits/c++config: Only do PSTL config when the header is
231         present, to fix freestanding.
232         * libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
233         functions if they were detected by configure.
235 2020-01-16  Kai-Uwe Eckhardt  <kuehro@gmx.de>
236             Matthew Bauer  <mjbauer95@gmail.com>
237             Jonathan Wakely  <jwakely@redhat.com>
239         PR bootstrap/64271 (partial)
240         * config/os/bsd/netbsd/ctype_base.h (ctype_base::mask): Change type
241         to unsigned short.
242         (ctype_base::alpha, ctype_base::digit, ctype_base::xdigit)
243         (ctype_base::print, ctype_base::graph, ctype_base::alnum): Sync
244         definitions with NetBSD upstream.
245         (ctype_base::blank): Use _CTYPE_BL.
246         * config/os/bsd/netbsd/ctype_configure_char.cc (_C_ctype_): Remove
247         Declaration.
248         (ctype<char>::classic_table): Use _C_ctype_tab_ instead of _C_ctype_.
249         (ctype<char>::do_toupper, ctype<char>::do_tolower): Cast char
250         parameters to unsigned char.
251         * config/os/bsd/netbsd/ctype_inline.h (ctype<char>::is): Likewise.
253 2020-01-16  François Dumont  <fdumont@gcc.gnu.org>
255         PR libstdc++/91263
256         * include/bits/hashtable.h (_Hashtable<>): Make _Equality<> friend.
257         * include/bits/hashtable_policy.h: Include <bits/stl_algo.h>.
258         (_Equality_base): Remove.
259         (_Equality<>::_M_equal): Review implementation. Use
260         std::is_permutation.
261         * testsuite/23_containers/unordered_multiset/operators/1.cc
262         (Hash, Equal, test02, test03): New.
263         * testsuite/23_containers/unordered_set/operators/1.cc
264         (Hash, Equal, test02, test03): New.
266 2020-01-15  Jonathan Wakely  <jwakely@redhat.com>
268         PR libstdc++/93267
269         * include/bits/iterator_concepts.h (__max_diff_type, __max_size_type):
270         Move here from <bits/range_access.h> and define using __int128 when
271         available.
272         (__is_integer_like, __is_signed_integer_like): Move here from
273         <bits/range_access.h>.
274         (weakly_incrementable): Use __is_signed_integer_like.
275         * include/bits/range_access.h (__max_diff_type, __max_size_type)
276         (__is_integer_like, __is_signed_integer_like): Move to
277         <bits/iterator_concepts.h>.
278         (__make_unsigned_like_t): Move here from <ranges>.
279         * include/std/ranges (__make_unsigned_like_t): Move to
280         <bits/range_access.h>.
281         (iota_view): Replace using-directive with using-declarations.
282         * testsuite/std/ranges/iota/93267.cc: New test.
283         * testsuite/std/ranges/iota_view.cc: Move to new 'iota' sub-directory.
285 2020-01-13  Jonathan Wakely  <jwakely@redhat.com>
287         PR libstdc++/93244
288         * include/bits/fs_path.h (path::generic_string<C,A>)
289         [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
290         * testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
291         root-dir is converted to forward slash in generic pathname.
292         * testsuite/27_io/filesystem/path/generic/utf.cc: New test.
293         * testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.
295         PR libstdc++/58605
296         * include/bits/atomic_base.h (__cpp_lib_atomic_value_initialization):
297         Define.
298         (__atomic_flag_base, __atomic_base, __atomic_base<_PTp*>)
299         (__atomic_float): Add default member initializer for C++20.
300         * include/std/atomic (atomic): Likewise.
301         (atomic::atomic()): Remove noexcept-specifier on default constructor.
302         * include/std/version (__cpp_lib_atomic_value_initialization): Define.
303         * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error line
304         number.
305         * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
306         * testsuite/29_atomics/atomic/cons/value_init.cc: New test.
307         * testsuite/29_atomics/atomic_flag/cons/value_init.cc: New test.
308         * testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Adjust
309         expected result for is_trivially_default_constructible.
310         * testsuite/29_atomics/atomic_float/requirements.cc: Likewise.
311         * testsuite/29_atomics/atomic_float/value_init.cc: New test.
312         * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise.
313         * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
314         * testsuite/29_atomics/atomic_integral/cons/value_init.cc
315         * testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Adjust
316         expected results for is_trivially_default_constructible.
317         * testsuite/util/testsuite_common_types.h (has_trivial_dtor): Add
318         new test generator.
320 2020-01-10  Jonathan Wakely  <jwakely@redhat.com>
322         * testsuite/util/testsuite_iterators.h: Improve comment.
324         * testsuite/25_algorithms/equal/deque_iterators/1.cc: Don't use C++11
325         initialization syntax.
327         PR libstdc++/92285
328         * include/bits/streambuf_iterator.h (istreambuf_iterator): Make type
329         of base class independent of __cplusplus value.
330         [__cplusplus < 201103L] (istreambuf_iterator::reference): Override the
331         type defined in the base class
332         * testsuite/24_iterators/istreambuf_iterator/92285.cc: New test.
333         * testsuite/24_iterators/istreambuf_iterator/requirements/
334         base_classes.cc: Adjust expected base class for C++98.
336 2020-01-09  Olivier Hainque  <hainque@adacore.com>
338         * doc/xml/manual/appendix_contributing.xml: Document _C2
339         as a reserved identifier, by VxWorks.
340         * include/bits/stl_map.h: Rename _C2 template typenames as _Cmp2.
341         * include/bits/stl_multimap.h: Likewise.
343 2020-01-09  Jonathan Wakely  <jwakely@redhat.com>
345         * include/ext/extptr_allocator.h (_ExtPtr_allocator::operator==)
346         (_ExtPtr_allocator::operator!=): Add missing const qualifiers.
347         * include/ext/pointer.h (readable_traits<_Pointer_adapter<S>>): Add
348         partial specialization to disambiguate the two constrained
349         specializations.
351         * include/experimental/type_traits (experimental::is_pod_v): Disable
352         -Wdeprecated-declarations warnings around reference to std::is_pod.
353         * include/std/type_traits (is_pod_v): Likewise.
354         * testsuite/18_support/max_align_t/requirements/2.cc: Also check
355         is_standard_layout and is_trivial. Do not check is_pod for C++20.
356         * testsuite/20_util/is_pod/requirements/explicit_instantiation.cc:
357         Add -Wno-deprecated for C++20.
358         * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
359         * testsuite/20_util/is_pod/value.cc: Likewise.
360         * testsuite/experimental/type_traits/value.cc: Likewise.
362 2020-01-09  JeanHeyd "ThePhD" Meneide  <phdofthehouse@gmail.com>
364         * include/bits/c++config (_GLIBCXX20_DEPRECATED): Add new macro.
365         * include/std/type_traits (is_pod, is_pod_v): Deprecate for C++20.
366         * testuite/20_util/is_pod/deprecated-2a.cc: New test.
368 2020-01-09  Jonathan Wakely  <jwakely@redhat.com>
370         PR libstdc++/93205
371         * include/bits/random.h (operator>>): Check stream operation succeeds.
372         * include/bits/random.tcc (operator<<): Remove redundant __ostream_type
373         typedefs.
374         (operator>>): Remove redundant __istream_type typedefs. Check stream
375         operations succeed.
376         (__extract_params): New function to fill a vector from a stream.
377         * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.
379         PR libstdc++/93208
380         * config/abi/pre/gnu.ver: Add new exports.
381         * include/std/memory_resource (memory_resource::~memory_resource()):
382         Do not define inline.
383         (monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
384         * src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
385         Define.
386         (monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
387         * testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.
389 2020-01-09  François Dumont  <fdumont@gcc.gnu.org>
391         PR libstdc++/92124
392         * include/bits/hashtable.h (_Hashtable<>::__alloc_node_gen_t): New
393         template alias.
394         (_Hashtable<>::__fwd_value_for): New.
395         (_Hashtable<>::_M_assign_elements<>): Remove _NodeGenerator template
396         parameter.
397         (_Hashtable<>::_M_assign<>): Add _Ht template parameter.
398         (_Hashtable<>::operator=(const _Hashtable<>&)): Adapt.
399         (_Hashtable<>::_M_move_assign): Adapt. Replace std::move_if_noexcept
400         with std::move.
401         (_Hashtable<>::_Hashtable(const _Hashtable&)): Adapt.
402         (_Hashtable<>::_Hashtable(const _Hashtable&, const allocator_type&)):
403         Adapt.
404         (_Hashtable<>::_Hashtable(_Hashtable&&, const allocator_type&)):
405         Adapt.
406         * testsuite/23_containers/unordered_set/92124.cc: New.
408 2020-01-08  Jonathan Wakely  <jwakely@redhat.com>
410         PR libstdc++/93201
411         * src/c++17/fs_ops.cc (do_remove_all): New function implementing more
412         detailed error reporting for remove_all. Check result of recursive
413         call before incrementing iterator.
414         (remove_all(const path&), remove_all(const path&, error_code&)): Use
415         do_remove_all.
416         * src/filesystem/ops.cc (remove_all(const path&, error_code&)): Check
417         result of recursive call before incrementing iterator.
418         * testsuite/27_io/filesystem/operations/remove_all.cc: Check errors
419         are reported correctly.
420         * testsuite/experimental/filesystem/operations/remove_all.cc: Likewise.
422 2020-01-07  Thomas Rodgers  <trodgers@redhat.com>
424         * include/std/condition_variable
425         (condition_variable_any::wait_on): Rename to match current draft
426         standard.
427         (condition_variable_any::wait_on_until): Likewise.
428         (condition_variable_any::wait_on_for): Likewise.
429         * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
430         Adjust tests to account for renamed methods.
432 2020-01-07  François Dumont  <fdumont@gcc.gnu.org>
434         PR libstdc++/92124
435         * include/bits/stl_tree.h
436         (_Rb_tree<>::_M_move_assign(_Rb_tree&, false_type)): Replace
437         std::move_if_noexcept by std::move.
438         * testsuite/23_containers/map/92124.cc: New.
439         * testsuite/23_containers/set/92124.cc: New.
441 2020-01-06  Jonathan Wakely  <jwakely@redhat.com>
443         * include/std/stop_token (stop_token): Remove operator!= (LWG 3254).
444         (stop_source): Likewise (LWG 3362).
445         * testsuite/30_threads/stop_token/stop_source.cc: Test equality
446         comparisons.
448         * include/bits/stl_algobase.h (__is_byte_iter, __min_cmp)
449         (lexicographical_compare_three_way): Do not depend on
450         __cpp_lib_concepts.
451         * include/std/version (__cpp_lib_three_way_comparison): Only define
452         when __cpp_lib_concepts is defined.
453         * libsupc++/compare (__cpp_lib_three_way_comparison): Likewise.
455 2020-01-03  Jonathan Wakely  <jwakely@redhat.com>
457         * include/bits/stl_algobase.h (lexicographical_compare_three_way):
458         Only define four-argument overload when __cpp_lib_concepts is defined.
460 2020-01-01  John David Anglin  <danglin@gcc.gnu.org>
462         * config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
464 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
466         Update copyright years.
468 Copyright (C) 2020 Free Software Foundation, Inc.
470 Copying and distribution of this file, with or without modification,
471 are permitted in any medium without royalty provided the copyright
472 notice and this notice are preserved.