2024-06-20 Release Manager * GCC 12.4.0 released. 2024-06-17 Jonathan Wakely Backported from master: 2024-06-14 Jonathan Wakely * libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Fix declaration of posix_memalign. 2024-06-11 Tianqiang Shuai <1101282468@qq.com> Backported from master: 2023-07-06 Tianqiang Shuai <1101282468@qq.com> * config/io/basic_file_stdio.cc (xwrite) [USE_STDIO_PURE]: Fix first argument. 2024-06-11 Jonathan Wakely Backported from master: 2023-03-22 Jonathan Wakely * include/std/utility (__cpp_lib_constexpr_algorithms): Define, as per LWG 3792. * testsuite/20_util/exchange/constexpr.cc: Check for it. 2024-06-11 Jonathan Wakely Backported from master: 2023-02-16 Jonathan Wakely * include/bits/fs_ops.h (create_directory): Use reserved name for parameter. * include/bits/regex_automaton.h (_State_base::_M_print): Likewise. * include/bits/regex_automaton.tcc(_State_base::_M_print): Likewise. * include/bits/regex_scanner.tcc(_Scanner::_M_print): Likewise. * include/experimental/bits/fs_ops.h (create_directory): Likewise. * include/std/mutex (timed_mutex::_M_clocklock): Likewise. (recursive_timed_mutex:_M_clocklock): Likewise. * libsupc++/cxxabi_init_exception.h (__cxa_init_primary_exception): Likewise. * testsuite/17_intro/names.cc: Add checks. 2024-06-11 Jonathan Wakely Backported from master: 2024-02-02 Jonathan Wakely * include/experimental/internet (network_v6::network): Define. (network_v6::hosts): Finish implementing. (network_v6::to_string): Do not concatenate std::string to arbitrary std::basic_string specialization. * testsuite/experimental/net/internet/network/v6/cons.cc: New test. 2024-06-11 Jonathan Wakely Backported from master: 2023-06-09 Jonathan Wakely PR libstdc++/100285 * include/experimental/internet [IPPROTO_TCP || IPPROTO_UDP] (basic_endpoint, basic_resolver_entry, resolver_base) (basic_resolver_results, basic_resolver): Only define if the tcp or udp protocols will be defined. 2024-06-11 Jonathan Wakely Backported from master: 2023-07-05 Jonathan Wakely PR libstdc++/110542 * include/bits/stl_uninitialized.h (__uninitialized_default_n): Do not use std::fill_n during constant evaluation. 2024-06-11 Jonathan Wakely Backported from master: 2024-04-10 Jonathan Wakely * testsuite/27_io/manipulators/extended/get_time/char/2.cc: Adjust input string so that it matches %a with or without a trailing period. 2024-06-11 Jonathan Wakely Backported from master: 2024-03-19 Jonathan Wakely PR libstdc++/114359 * include/bits/random.tcc (binomial_distribution::param_type): Ensure arithmetic is done as type double. * testsuite/26_numerics/random/binomial_distribution/114359.cc: New test. 2024-06-11 Jonathan Wakely Backported from master: 2024-03-19 Jonathan Wakely PR libstdc++/114367 * include/bits/stl_bvector.h (_M_allocate): Use allocator's construct function to begin lifetime of words. 2024-06-11 Jonathan Wakely Backported from master: 2024-04-03 Jonathan Wakely PR libstdc++/104606 * include/std/optional (operator<=>(const optional&, const U&)): Reverse order of three_way_comparable_with template arguments. * testsuite/20_util/optional/relops/104606.cc: New test. 2024-06-11 Jonathan Wakely Backported from master: 2024-03-22 Jonathan Wakely PR libstdc++/114401 * include/bits/hashtable.h (_Hashtable::_M_reinsert_node): Call release() on node handle instead of just zeroing its pointer. (_Hashtable::_M_reinsert_node_multi): Likewise. (_Hashtable::_M_merge_unique): Likewise. (_Hashtable::_M_merge_multi): Likewise. * include/bits/node_handle.h (_Node_handle_common::release()): New member function. (_Node_handle_common::_Optional_alloc::_M_empty): Remove unnecessary union member. (_Node_handle_common): Declare _Hashtable as a friend. * include/bits/stl_tree.h (_Rb_tree::_M_reinsert_node_unique): Call release() on node handle instead of just zeroing its pointer. (_Rb_tree::_M_reinsert_node_equal): Likewise. (_Rb_tree::_M_reinsert_node_hint_unique): Likewise. (_Rb_tree::_M_reinsert_node_hint_equal): Likewise. * testsuite/23_containers/multiset/modifiers/114401.cc: New test. * testsuite/23_containers/set/modifiers/114401.cc: New test. * testsuite/23_containers/unordered_multiset/modifiers/114401.cc: New test. * testsuite/23_containers/unordered_set/modifiers/114401.cc: New test. 2024-06-01 Jonathan Wakely Backported from master: 2024-06-01 Jonathan Wakely PR libstdc++/115269 * doc/xml/manual/using.xml: Replace link to gcc-4.3.2 docs. Replace list of -std=... options with a single entry for -std. * doc/html/manual/using.html: Regenerate. 2024-05-08 Matthias Kretz Backported from master: 2024-04-22 Matthias Kretz PR libstdc++/114803 * include/experimental/bits/simd_builtin.h (_SimdBase2::operator __vector_type_t): There is no __builtin() function in _SimdWrapper, instead use its conversion operator. * testsuite/experimental/simd/pr114803_vecbuiltin_cvt.cc: New test. 2024-05-08 Matthias Kretz Backported from master: 2024-04-22 Matthias Kretz * include/experimental/bits/simd.h: Ignore -Wnarrowing for arm_neon.h. (__int_for_sizeof): Replace tautological compare with checking for invalid template parameter value. * include/experimental/bits/simd_builtin.h (__extract_part): Remove tautological compare by combining two static_assert. 2024-05-08 Matthias Kretz Backported from master: 2024-04-17 Matthias Kretz * include/experimental/bits/numeric_traits.h: Add include guard. 2024-05-08 Matthias Kretz Backported from master: 2024-04-17 Matthias Kretz PR libstdc++/114750 * include/experimental/bits/simd_builtin.h (_SimdImplBuiltin::_S_load, _S_store): Fall back to copying scalars if the memory type cannot be vectorized for the target. 2024-05-08 Matthias Kretz Backported from master: 2024-03-27 Matthias Kretz * include/experimental/bits/simd_x86.h (_S_masked_unary): Cast inputs < 16 bytes to 16 byte vectors before calling the right subtraction builtin. Before returning, truncate to the return vector type. 2024-05-08 Matthias Kretz Backported from master: 2024-03-27 Matthias Kretz * include/experimental/bits/simd_x86.h (_S_masked_unary): Call the 4- and 8-byte variants of __builtin_ia32_subp[ds] without rounding direction argument. 2024-05-08 Matthias Kretz Backported from master: 2023-06-06 Matthias Kretz PR libstdc++/109822 * include/experimental/bits/simd_builtin.h (_S_store): Rewrite to avoid casts to other vector types. Implement store as succession of power-of-2 sized memcpy to avoid PR90424. 2024-05-08 Matthias Kretz Backported from master: 2023-06-06 Matthias Kretz PR libstdc++/110054 * include/experimental/bits/simd_builtin.h (_S_masked_store): Call into deduced ABI's SimdImpl after conversion. * include/experimental/bits/simd_x86.h (_S_masked_store_nocvt): Don't use _mm_maskmoveu_si128. Use the generic fall-back implementation. Also fix masked stores without SSE2, which were not doing anything before. 2024-05-08 Matthias Kretz Backported from master: 2023-06-06 Matthias Kretz * include/experimental/bits/simd.h (__bit_cast): Use __gnu__::__vector_size__ instead of gnu::vector_size. 2024-04-21 Iain Sandoe Backported from master: 2024-02-19 Iain Sandoe Jonathan Wakely PR target/112397 * configure: Regenerate. * configure.ac: Detect if we are building for Darwin. * libsupc++/Makefile.am: If we are building for Darwin, then suppress hot/cold partitioning for the array allocators. * libsupc++/Makefile.in: Regenerated. 2024-04-21 Iain Sandoe Backported from master: 2024-03-19 Iain Sandoe * testsuite/lib/dg-options.exp (atomic_link_flags): Emit a -B option for the path to the uninstalled libatomic. 2024-04-21 Iain Sandoe Backported from master: 2024-03-19 Iain Sandoe * testsuite/lib/libstdc++.exp (v3_target_compile): Instead of /dev/null, use a temporary file for test executables on Darwin. 2024-04-18 Iain Sandoe Backported from master: 2022-12-04 Iain Sandoe * config/os/bsd/darwin/os_defines.h (_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC): Limit use of this macro to OS versions that need it. 2024-03-18 Jonathan Wakely Backported from master: 2023-05-12 Jonathan Wakely * testsuite/experimental/feat-cxx14.cc: Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1. 2024-03-18 Jonathan Wakely Backported from master: 2023-05-12 Jonathan Wakely * testsuite/21_strings/basic_string_view/typedefs.cc: Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1. * testsuite/experimental/string_view/typedefs.cc: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2023-09-11 Jonathan Wakely * src/c++11/Makefile.am: Add new file. * src/c++11/Makefile.in: Regenerate. * src/c++11/debug.cc (__glibcxx_assert_fail): Move to ... * src/c++11/assert_fail.cc: New file. 2024-03-18 Jonathan Wakely Backported from master: 2023-06-26 Jonathan Wakely * include/bits/iterator_concepts.h (projected): Replace class template with alias template denoting an ADL-proofed helper. (incremental_traits>): Remove. * testsuite/24_iterators/indirect_callable/projected-adl.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-04-27 Jonathan Wakely PR libstdc++/40380 * include/bits/basic_string.h: Improve doxygen comments. * include/bits/cow_string.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/fs_dir.h: Likewise. * include/bits/fs_path.h: Likewise. * include/bits/quoted_string.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/std/filesystem: Likewise. * include/std/iomanip: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-11-19 Jonathan Wakely * include/bits/ptr_traits.h (pointer_traits::pointer_to): Rename parameter. 2024-03-18 Jonathan Wakely Backported from master: 2022-11-21 Jonathan Wakely * include/std/tuple: Add better Doxygen comments. 2024-03-18 Jonathan Wakely Backported from master: 2022-11-08 Jonathan Wakely * testsuite/18_support/new_nothrow.cc: Add missing noexcept to operator delete replacements. * testsuite/20_util/any/cons/92156.cc: Disable -Winit-list-lifetime warnings from instantiating invalid specialization of manager function. * testsuite/20_util/any/modifiers/92156.cc: Likewise. * testsuite/20_util/default_delete/void_neg.cc: Prune additional diagnostics. * testsuite/20_util/headers/memory/synopsis.cc: Add missing noexcept. * testsuite/20_util/shared_ptr/cons/void_neg.cc: Prune additional diagnostic. * testsuite/20_util/unique_ptr/creation/for_overwrite.cc: Add missing noexcept to operator delete replacements. * testsuite/21_strings/basic_string/cons/char/103919.cc: Likewise. * testsuite/23_containers/map/modifiers/emplace/92300.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/92300.cc: Likewise. * testsuite/24_iterators/headers/iterator/range_access_c++11.cc: Add missing noexcept to synopsis declarations. * testsuite/24_iterators/headers/iterator/range_access_c++14.cc: Likewise. * testsuite/24_iterators/headers/iterator/range_access_c++17.cc: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-09-21 Jonathan Wakely * testsuite/20_util/headers/memory/synopsis.cc: Add declarations from C++11 and later. 2024-03-18 Jonathan Wakely Backported from master: 2022-11-08 Jonathan Wakely * include/bits/stl_tempbuf.h (_Temporary_buffer): Disable warnings about get_temporary_buffer being deprecated. * include/ext/functional (mem_fun1, mem_fun1_ref): Disable warnings about mem_fun1_t, const_mem_fun1_t, mem_fun1_ref_t and const_mem_fun1_ref_t being deprecated. * include/std/spanstream (basic_spanbuf::setbuf): Add assertion and adjust to avoid narrowing warning. * libsupc++/exception_ptr.h [!__cpp_rtti && !__cpp_exceptions] (make_exception_ptr): Add missing inline specifier. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (PREDEFINED): Define _GTHREAD_USE_MUTEX_TIMEDLOCK macro. * include/bits/std_mutex.h (mutex, lock_guard): Use @since and @headerfile. * include/bits/unique_lock.h (unique_lock): Likewise. * include/std/mutex (recursive_mutex, timed_mutex) (recursive_timed_mutex, scoped_lock): Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (PREDEFINED): Define _GLIBCXX23_CONSTEXPR macro. * include/backward/auto_ptr.h (auto_ptr): Use @deprecated. * include/bits/unique_ptr.h (default_delete): Use @since and @headerfile. * include/std/scoped_allocator: Remove @ingroup from @file block. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/bits/ostream_insert.h: Mark helper functions as undocumented by Doxygen. * include/bits/stl_algo.h: Use markdown for formatting and mark helper functions as undocumented. * include/bits/stl_numeric.h: Likewise. * include/bits/stl_pair.h (pair): Add @headerfile. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (PREDEFINED): Define __allocator_base so that Doxygen shows the right base-class for std::allocator. * include/bits/alloc_traits.h: Improve doxygen docs. * include/bits/allocator.h: Likewise. * include/bits/new_allocator.h: Likewise. * include/ext/new_allocator.h: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (PREDEFINED): Define macro _GLIBCXX_DOXYGEN_ONLY to expand its argument. * include/bits/c++config (_GLIBCXX_DOXYGEN_ONLY): Define. * include/bits/regex.h: Improve doxygen docs. * include/bits/regex_constants.h: Likewise. * include/bits/regex_error.h: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/std/atomic: Suppress doxygen docs for implementation details. * include/bits/atomic_base.h: Likewise. * include/bits/shared_ptr_atomic.h: Use markdown. Fix grouping so that std::atomic is not added to the pointer abstractions group. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-17 Jonathan Wakely * src/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE] (cxx11_sources): Do not build the compatibility*-c++0x.cc objects. * src/Makefile.in: Regenerate. * src/c++11/compatibility-c++0x.cc [_GLIBCXX_INLINE_VERSION]: Refuse to build for the versioned namespace. * src/c++11/compatibility-chrono.cc: Likewise. * src/c++11/compatibility-condvar.cc: Likewise. * src/c++11/compatibility-thread-c++0x.cc: Likewise. * src/c++11/chrono.cc (system_clock, steady_clock): Use macros to define in inline namespace _V2, matching the declarations in . * src/c++11/system_error.cc (system_category, generic_category): Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (PREDEFINED): Expand new macros to nothing. * include/bits/c++config (_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE) (_GLIBCXX_END_INLINE_ABI_NAMESPACE): Define new macros. * include/bits/algorithmfwd.h (_V2::__rotate): Use new macros for the namespace. * include/bits/chrono.h (chrono::_V2::system_clock): Likewise. * include/bits/stl_algo.h (_V2::__rotate): Likewise. * include/std/condition_variable (_V2::condition_variable_any): Likewise. * include/std/system_error (_V2::error_category): Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * doc/doxygen/user.cfg.in (GROUP_NESTED_COMPOUNDS): Set to NO. (CLASS_DIAGRAMS): Remove obsolete option. 2024-03-18 Jonathan Wakely Backported from master: 2022-06-27 Jonathan Wakely * include/bits/fs_path.h (__is_path_iter_src): Replace class template with variable template. 2024-03-18 Jonathan Wakely Backported from master: 2022-09-26 Jonathan Wakely * include/bits/ptr_traits.h (__ptr_traits_elem) [__cpp_concepts]: Also define the __ptr_traits_elem class template for the concepts case. (pointer_traits): Remove constrained partial specialization. * testsuite/20_util/pointer_traits/lwg3545.cc: Check for ambiguitiy with program-defined partial specialization. 2024-03-18 Jonathan Wakely Backported from master: 2022-09-24 Jonathan Wakely * include/bits/alloc_traits.h (allocator_traits::is_always_equal): Only instantiate is_empty if needed. * include/bits/ptr_traits.h (__ptr_traits_impl::difference_type) (__ptr_traits_impl::rebind): Use __detected_or. * include/experimental/type_traits (is_same_v): Add a partial specialization instead of instantiating the std::is_same class template. (detected_t): Redefine in terms of detected_or_t. (is_detected, is_detected_v): Redefine in terms of detected_t. * include/std/type_traits [__cpp_concepts] (__detected_or): Add new definition using concepts. (__detector::value_t): Rename to __is_detected. * testsuite/17_intro/names.cc: Check value_t isn't used. 2024-03-18 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/bits/ptr_traits.h: Add some doxygen comments. 2024-03-18 Xi Ruoyao Backported from master: 2022-06-24 Xi Ruoyao * scripts/extract_symvers.in: Use grep -E instead of egrep. * scripts/run_doxygen: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2022-10-28 Jonathan Wakely PR libstdc++/107376 * include/bits/regex_executor.h (_Executor::_Executor): Use same allocator for _M_cur_results and _M_results. * include/bits/regex_executor.tcc (_Executor::_M_main_dispatch): Prevent possibly incorrect allocator propagating to _M_cur_results. * testsuite/28_regex/algorithms/regex_match/107376.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-02-02 Jonathan Wakely * include/std/sstream (basic_stringbuf::view): Define for old std::string ABI. (basic_istringstream::view, basic_stringstream::view) (basic_stringstream::view): Likewise. * testsuite/27_io/basic_istringstream/view/char/1.cc: Remove { dg-require-effective-target cxx11_abi }. * testsuite/27_io/basic_istringstream/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/view/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_stringbuf/view/char/1.cc: Likewise. * testsuite/27_io/basic_stringbuf/view/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_stringstream/view/char/1.cc: Likewise. * testsuite/27_io/basic_stringstream/view/wchar_t/1.cc: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2023-09-07 Jonathan Wakely * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir, chmod, chdir, and getcwd. * config.h.in: Regenerate. * configure: Regenerate. * src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro. (fs::current_path): Use USE_GETCWD and USE_CHDIR macros. (fs::permissions): Use USE_CHMOD macro. * src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Define new macros. [FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use new macros. * src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro. (fs::current_path): Use USE_GETCWD and USE_CHDIR macros. (fs::permissions): Use USE_CHMOD macro. 2024-03-18 Jonathan Wakely Backported from master: 2023-08-09 Jonathan Wakely * include/bits/new_allocator.h (__new_allocator): Define copy assignment operator as defaulted. * include/std/complex (complex, complex) (complex): Define copy constructor as defaulted. 2024-03-18 Jonathan Wakely Backported from master: 2023-11-11 Jonathan Wakely PR libstdc++/112473 * include/bits/utility.h (integer_sequence): Add static_assert. * testsuite/20_util/integer_sequence/112473.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-09-15 Jonathan Wakely PR libstdc++/111172 * include/std/variant (get): Remove !is_void static assertions. 2024-03-18 Jonathan Wakely Backported from master: 2023-10-26 Jonathan Wakely PR libstdc++/112089 * include/std/shared_mutex (shared_lock::unlock): Change errc constant to operation_not_permitted. * testsuite/30_threads/shared_lock/locking/112089.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2024-02-29 Jonathan Wakely PR libstdc++/113960 * include/bits/stl_algobase.h (__is_byte_iter): Replace with ... (__memcmp_ordered_with): New concept. (lexicographical_compare_three_way): Use __memcmp_ordered_with instead of __is_byte_iter. Use correct length for memcmp. * testsuite/25_algorithms/lexicographical_compare_three_way/113960.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-02-28 Jonathan Wakely PR libstdc++/108846 * include/bits/stl_algobase.h (__copy_move) Add __assign_one static member function. (__copy_move): Likewise. (__copy_move): Do not use memmove for a single value. (__copy_move_backward): Likewise. * testsuite/25_algorithms/copy/108846.cc: New test. * testsuite/25_algorithms/copy_backward/108846.cc: New test. * testsuite/25_algorithms/copy_n/108846.cc: New test. * testsuite/25_algorithms/move/108846.cc: New test. * testsuite/25_algorithms/move_backward/108846.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-03-22 Jonathan Wakely * include/bits/stream_iterator.h (istream_iterator): Add constexpr to copy constructor, as per LWG 3600. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: Check copy construction. 2024-03-18 Jonathan Wakely Backported from master: 2023-03-22 Jonathan Wakely * include/bits/regex.h (match_results): Add allocator-extended copy and move constructors, as per LWG 2195. * testsuite/28_regex/match_results/ctors/char/alloc.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-02-28 Jonathan Wakely * src/c++11/codecvt.cc: Add [[likely]] and [[unlikely]] attributes. 2024-03-18 Dimitrij Mijoski Backported from master: 2023-01-13 Dimitrij Mijoski PR libstdc++/86419 * src/c++11/codecvt.cc (read_utf8_code_point): Correctly detect errors in incomplete multibyte sequences. (utf16_in): Remove surrogates parameter. Fix conditions for returning partial. (utf16_out): Fix condition for returning partial. (ucs2_in): Do not pass surrogates argument to utf16_in. * testsuite/22_locale/codecvt/codecvt_unicode.cc: New test. * testsuite/22_locale/codecvt/codecvt_unicode.h: New header for tests. * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-07-26 Jonathan Wakely * include/bits/algorithmfwd.h (random_shuffle): Add deprecated attribute. * include/bits/stl_algo.h (random_shuffle): Correct comments. * testsuite/25_algorithms/random_shuffle/1.cc: Disable deprecated warnings. * testsuite/25_algorithms/random_shuffle/59603.cc: Likewise. * testsuite/25_algorithms/random_shuffle/moveable.cc: Likewise. * testsuite/25_algorithms/random_shuffle/deprecated.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-05-11 Jonathan Wakely PR libstdc++/109758 * include/bits/std_abs.h (abs(__float128)): Handle negative NaN and negative zero correctly. * testsuite/26_numerics/headers/cmath/109758.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-05-12 Jonathan Wakely * acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Use a non-null pointer to check for nan, nanf, and nanl. * configure: Regenerate. 2024-03-18 Jonathan Wakely Backported from master: 2023-05-31 Jonathan Wakely * include/std/scoped_allocator (scoped_allocator_adaptor): Add noexcept to all constructors except the default constructor. (scoped_allocator_adaptor::inner_allocator): Add noexcept. (scoped_allocator_adaptor::outer_allocator): Likewise. * testsuite/20_util/scoped_allocator/noexcept.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-06-01 Jonathan Wakely * testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc: Add const to equality operator. 2024-03-18 Jonathan Wakely Backported from master: 2023-06-09 Jonathan Wakely * testsuite/23_containers/deque/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/list/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/vector/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/deque/modifiers/emplace/1.cc: New test. * testsuite/23_containers/list/modifiers/emplace/1.cc: New test. * testsuite/23_containers/vector/modifiers/emplace/1.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-07-03 Jonathan Wakely * include/bits/alloc_traits.h (_Destroy): Qualify call. * include/bits/stl_construct.h (_Destroy, _Destroy_n): Likewise. * testsuite/23_containers/vector/cons/destroy-adl.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-07-19 Jonathan Wakely PR libstdc++/110593 * include/bits/chrono.h (duration): Improve static assert messages. (__is_ratio): Move to ... * include/std/ratio (__is_ratio): ... here. (__is_ratio_v): New variable template and partial specialization. (__are_both_ratios): New function template. (__ratio_multiply, ratio_equal, ratio_less, __ratio_add): Add static assertion. * testsuite/20_util/ratio/requirements/type_constraints.cc: New test. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust expected error. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. 2024-03-18 Jonathan Wakely Backported from master: 2023-09-11 Jonathan Wakely * src/c++11/debug.cc (acquire_sequence_ptr_for_lock): New function. (reset_sequence_ptr): New function. (_Safe_iterator_base::_M_detach) (_Safe_local_iterator_base::_M_detach): Replace bare atomic_load with acquire_sequence_ptr_for_lock. (_Safe_iterator_base::_M_reset): Replace bare atomic_store with reset_sequence_ptr. 2024-03-18 Jonathan Wakely Backported from master: 2023-08-16 Jonathan Wakely * include/bits/basic_string.tcc (resize_and_overwrite): Invoke the callable with the same size as resize_and_overwrite was called with. * testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc: Check with small values for the new size. 2024-03-18 Jonathan Wakely Backported from master: 2023-03-22 Jonathan Wakely * include/bits/basic_string.tcc (basic_string::resize_and_overwrite): Pass rvalues to the callback, as now allowed by LWG 3645. Enforce preconditions on the return value. * testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc: Adjust. 2024-03-18 Jonathan Wakely Backported from master: 2023-08-09 Jonathan Wakely * include/bits/shared_ptr_atomic.h (atomic): Change class-head to struct. * include/bits/stl_tree.h (_Rb_tree_merge_helper): Change class-head to struct in friend declaration. * include/std/future (_Task_state_base, _Task_state): Likewise. * include/std/scoped_allocator (__inner_type_impl): Likewise. * include/std/valarray (_BinClos, _SClos, _GClos, _IClos) (_ValFunClos, _RefFunClos): Change class-head to struct. 2024-03-18 Jonathan Wakely Backported from master: 2023-09-08 Jonathan Wakely * doc/xml/manual/test.xml: Update reference to -std=gnu++14 as the default. * doc/html/manual/test.html: Regenerate. 2024-03-18 Alexey Lapshin Backported from master: 2023-09-08 Alexey Lapshin * src/libbacktrace/Makefile.am: Remove -Werror. * src/libbacktrace/Makefile.in: Regenerate. 2024-03-18 Nathaniel Shead Backported from master: 2023-09-29 Nathaniel Shead * include/bits/basic_string.h: (basic_string(basic_string&&)): Activate _M_local_buf when needed. (basic_string(basic_string&&, const _Alloc&)): Likewise. * include/bits/basic_string.tcc: (basic_string::swap): Likewise. * include/std/variant: (__detail::__variant::__construct_n): New. (__detail::__variant::__emplace): Use __construct_n. 2024-03-18 Jonathan Wakely Backported from master: 2023-11-02 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_C99): Fix snprintf checks. * configure: Regenerate. 2024-03-18 Jonathan Wakely Backported from master: 2023-11-21 Jonathan Wakely * include/tr2/dynamic_bitset (dynamic_bitset): Pass zero and one characters to _M_copy_from_string. * testsuite/tr2/dynamic_bitset/string.cc: New test. 2024-03-18 Jonathan Wakely Backported from master: 2023-11-14 Jonathan Wakely * include/std/charconv (__from_chars_pow2_base): Convert base to unsigned for call to __countr_zero. (__from_chars_alnum): Likewise for call to __bit_width. 2024-03-18 Jonathan Wakely Backported from master: 2023-11-23 Jonathan Wakely * testsuite/util/testsuite_allocator.h (uneq_allocator): Fix equality operator for heterogeneous comparisons. 2024-03-18 Jonathan Wakely Backported from master: 2024-03-14 Jonathan Wakely PR libstdc++/66146 * doc/xml/manual/status_cxx2011.xml: Remove mention of Linux in note about std::call_once. * doc/xml/manual/status_cxx2014.xml: Likewise. * doc/xml/manual/status_cxx2017.xml: Likewise. * doc/html/manual/status.html: Regenerate. 2024-03-18 Jonathan Wakely Backported from master: 2024-03-13 Jonathan Wakely * testsuite/libstdc++-prettyprinters/cxx11.cc: Move custom_cat to namespace scope. 2024-03-18 Jonathan Wakely Backported from master: 2024-02-28 Jonathan Wakely * doc/xml/manual/appendix_contributing.xml: Change URLs to use https. * doc/html/manual/*: Regenerate. 2024-03-18 Jonathan Wakely Backported from master: 2024-02-28 Jonathan Wakely * doc/xml/manual/appendix_contributing.xml: Replace outdated info on ChangeLog entries. * doc/html/manual/appendix_contributing.html: Regenerate. 2024-03-18 Jonathan Wakely Backported from master: 2022-11-04 Jonathan Wakely PR libstdc++/107500 * libsupc++/eh_globals.cc (eh_globals): Remove immortalizing wrapper. (__cxxabiv1::__cxa_get_globals_fast): Adjust. (__cxxabiv1::__cxa_get_globals): Adjust. 2024-03-18 Jonathan Wakely Backported from master: 2024-03-04 Jonathan Wakely PR libstdc++/114147 * include/std/tuple (tuple::tuple(allocator_arg_t, const Alloc&)): Add missing overload of allocator-extended default constructor. (tuple::tuple(allocator_arg_t, const Alloc&)): Likewise. * testsuite/20_util/tuple/cons/114147.cc: New test. 2024-03-13 Cassio Neri Backported from master: 2024-01-05 Cassio Neri * include/std/chrono: Fix + and - for months and weekdays. * testsuite/std/time/month/1.cc: Add constexpr tests against overflow. * testsuite/std/time/month/2.cc: New test for extreme values. * testsuite/std/time/weekday/1.cc: Add constexpr tests against overflow. * testsuite/std/time/weekday/2.cc: New test for extreme values. 2024-03-13 Cassio Neri Backported from master: 2023-11-14 Cassio Neri * include/std/chrono (operator-(const weekday&, const weekday&)): Optimize. 2024-03-13 Cassio Neri Backported from master: 2023-11-14 Cassio Neri * include/std/chrono (year::is_leap): Clear code. 2024-03-13 Cassio Neri Backported from master: 2023-11-14 Cassio Neri * include/std/chrono (year_month_day_last::day): Remove &1. 2024-03-13 Cassio Neri Backported from master: 2023-11-14 Cassio Neri * include/std/chrono (weekday::_S_from_days): Fix UB. * testsuite/std/time/weekday/1.cc: Add test for overflow. 2024-03-13 Jonathan Wakely Backported from master: 2023-08-09 Jonathan Wakely * include/bits/list.tcc (list::sort(Cmp)): Fix -Wsign-compare warning for loop condition. 2024-03-13 Jonathan Wakely Backported from master: 2023-06-09 Jonathan Wakely PR libstdc++/110167 * include/std/array (to_array): Initialize arrays of trivial types using memcpy. For non-trivial types, use lambda expressions instead of a separate helper function. (__to_array): Remove. * testsuite/23_containers/array/creation/110167.cc: New test. 2024-02-08 Jonathan Wakely Backported from master: 2024-02-02 Jonathan Wakely * include/std/string_view (basic_string_view(R&&)): Remove constraint that traits_type must be the same, as per LWG 3857. * testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: Explicit conversion between different specializations should be allowed. * testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: Likewise. 2024-02-08 Jonathan Wakely Backported from master: 2024-02-02 Jonathan Wakely PR libstdc++/90276 * testsuite/util/pstl/test_utils.h (reverse_invoker): Do not use perfect forwarding for iterator arguments. 2024-02-08 Jonathan Wakely Backported from master: 2024-02-02 Jonathan Wakely * include/std/syncstream (basic_osyncstream::operator=): Remove noexcept, as per LWG 3867. 2024-02-08 Jonathan Wakely Backported from master: 2024-01-13 Jonathan Wakely PR libstdc++/107466 * include/bits/random.tcc (subtract_with_carry_engine::seed): Implement proposed resolution of LWG 4014. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: Check for expected result of 64-bit engine with seed that doesn't fit in 32-bits. 2024-02-08 Jonathan Wakely Backported from master: 2024-01-11 Jonathan Wakely PR libstdc++/113258 * libsupc++/new_opa.cc: Prefer to use posix_memalign if available. 2024-02-02 Jonathan Wakely PR libstdc++/108636 * include/bits/shared_ptr_base.h (__shared_ptr::operator bool): Add always_inline attribute for C++20 and later. 2024-01-11 Jonathan Wakely Backported from master: 2024-01-05 Jonathan Wakely PR libstdc++/113200 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Use __builtin_constant_p to check for unrelated pointers that cannot be compared during constant evaluation. * testsuite/21_strings/char_traits/requirements/113200.cc: New test. 2024-01-11 Ken Matsui Backported from master: 2024-01-11 Ken Matsui PR libstdc++/113250 * src/c++17/fs_ops.cc (fs::equivalent): Use || instead of &&. * src/filesystem/ops.cc (fs::equivalent): Likewise. * testsuite/27_io/filesystem/operations/equivalent.cc: Handle error codes. * testsuite/experimental/filesystem/operations/equivalent.cc: Likewise. 2024-01-03 Patrick Palka Backported from master: 2024-01-03 Patrick Palka PR testsuite/113175 * testsuite/std/ranges/iota/max_size_type.cc (test02): Reduce 'limit' to 100 from 1000 and adjust 'log2_limit' accordingly. (test03): Likewise. 2023-12-16 Jakub Jelinek Backported from master: 2023-10-13 Jakub Jelinek * testsuite/tr1/8_c_compatibility/cstdio/functions.cc (test01): Initialize stream to va_arg(ap, FILE*) rather than 0. * testsuite/tr1/8_c_compatibility/cwchar/functions.cc (test01): Likewise. 2023-12-06 Jonathan Wakely Backported from master: 2023-11-02 Jonathan Wakely PR libstdc++/112314 * include/std/string_view (string_view::remove_suffix): Add debug assertion. * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/debug.cc: New test. * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/debug.cc: New test. 2023-12-06 Jonathan Wakely Backported from master: 2023-11-17 Jonathan Wakely * include/std/utility (in_range): Rename _Up parameter to _Res. 2023-11-15 Jonathan Wakely Backported from master: 2023-11-15 Jonathan Wakely PR libstdc++/112491 * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index): Correctly handle unused capacity at the start of the first node. * testsuite/libstdc++-xmethods/deque.cc: Check index operator when elements have been removed from the front. 2023-11-15 Jonathan Wakely Backported from master: 2023-11-15 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::at): Fix class name in exception message. * testsuite/19_diagnostics/stacktrace/hash.cc: Do not fail if current() returns a non-empty stacktrace. 2023-11-14 Jonathan Wakely Backported from master: 2023-11-14 Jonathan Wakely PR libstdc++/112348 * include/std/stacktrace (hash>): Fix type of hash function for entries. * testsuite/19_diagnostics/stacktrace/hash.cc: New test. 2023-11-14 Jonathan Wakely Backported from master: 2023-11-14 Jonathan Wakely PR libstdc++/112491 * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.size): Fix calculation to use _M_start._M_cur. * testsuite/libstdc++-xmethods/deque.cc: Check failing cases. 2023-11-13 Tom Tromey Backported from master: 2023-10-04 Tom Tromey * python/libstdcxx/v6/printers.py (StdExpAnyPrinter.__init__): Qualify call to _string_types. 2023-11-13 Tom Tromey Backported from master: 2023-10-04 Tom Tromey * python/libstdcxx/v6/printers.py: Assume that _versioned_namespace is non-None. * python/libstdcxx/v6/xmethods.py (is_specialization_of): Assume that _versioned_namespace is non-None. 2023-11-13 Tom Tromey Backported from master: 2023-09-28 Tom Tromey * python/libstdcxx/v6/printers.py (Printer.add_version) (add_one_template_type_printer) (FilteringTypePrinter.add_one_type_printer): Use Python "not in" operator. 2023-11-13 Tom Tromey Backported from master: 2023-10-04 Tom Tromey * python/libstdcxx/v6/xmethods.py (_versioned_namespace): Define. 2023-11-13 Jonathan Wakely Backported from master: 2023-09-28 Jonathan Wakely * python/libstdcxx/v6/xmethods.py (is_specialization_of): Define new function. (ArrayMethodsMatcher, DequeMethodsMatcher) (ForwardListMethodsMatcher, ListMethodsMatcher) (VectorMethodsMatcher, AssociativeContainerMethodsMatcher) (UniquePtrGetWorker, UniquePtrMethodsMatcher) (SharedPtrSubscriptWorker, SharedPtrMethodsMatcher): Use is_specialization_of instead of re.match. 2023-11-13 Jonathan Wakely Backported from master: 2023-09-28 Jonathan Wakely * python/libstdcxx/v6/printers.py: Break long lines. Use raw strings for regular expressions. Add whitespace around operators. (is_member_of_namespace): Use isinstance to check type. (is_specialization_of): Likewise. Adjust template_name for versioned namespace instead of duplicating the re.match call. (StdExpAnyPrinter._string_types): New static method. (StdExpAnyPrinter.to_string): Use _string_types. 2023-11-13 Jonathan Wakely Backported from master: 2023-09-28 Jonathan Wakely * python/libstdcxx/v6/printers.py: Format docstrings according to PEP 257. * python/libstdcxx/v6/xmethods.py: Likewise. 2023-11-13 Jonathan Wakely Backported from master: 2023-09-12 Jonathan Wakely * python/libstdcxx/v6/printers.py: Reformat. * python/libstdcxx/v6/xmethods.py: Likewise. 2023-11-06 Ian Lance Taylor PR libbacktrace/111315 PR libbacktrace/112263 * acinclude.m4: Set -D_GNU_SOURCE in BACKTRACE_CPPFLAGS and when grepping link.h for dl_iterate_phdr. * configure: Regenerate. 2023-10-25 Jonathan Wakely Backported from master: 2023-10-25 Jonathan Wakely PR libstdc++/111936 * src/libbacktrace/Makefile.am: Add -prefer-pic to libtool compile commands. * src/libbacktrace/Makefile.in: Regenerate. 2023-10-23 François Dumont * include/bits/hashtable_policy.h (_Hash_code_base::_M_hash_code(const _Hash&, const _Hash_node_value<>&)): Remove. (_Hash_code_base::_M_hash_code<_H2>(const _H2&, const _Hash_node_value<>&)): Remove. * include/bits/hashtable.h (_M_src_hash_code<_H2>(const _H2&, const key_type&, const __node_value_type&)): New. (_M_merge_unique<>, _M_merge_multi<>): Use latter. * testsuite/23_containers/unordered_map/modifiers/merge.cc (test04, test05, test06): New test cases. 2023-10-03 Jonathan Wakely * include/bits/fs_dir.h (directory_iterator::operator==): Define without using a non-exported shared_ptr symbol. (recursive_directory_iterator::operator==): Likewise. 2023-10-03 Jonathan Wakely Backported from master: 2023-09-01 Jonathan Wakely * testsuite/27_io/filesystem/path/108636.cc: Add dg-require for filesystem support. 2023-10-03 Jonathan Wakely Backported from master: 2023-06-06 Jonathan Wakely PR libstdc++/108178 * src/filesystem/ops-common.h (do_copy_file): Check for empty files by trying to read a character. * testsuite/27_io/filesystem/operations/copy_file_108178.cc: New test. 2023-10-03 Jonathan Wakely Backported from master: 2023-06-06 Jonathan Wakely * src/filesystem/ops-common.h (do_copy_file) [O_CLOEXEC]: Set close-on-exec flag on file descriptors. 2023-10-03 Jonathan Wakely Backported from master: 2023-03-20 Jonathan Wakely * src/filesystem/ops-common.h (get_temp_directory_from_env): Fix formatting. 2023-10-03 Jonathan Wakely Backported from master: 2023-02-02 Jonathan Wakely * src/filesystem/ops-common.h [AVR] (__unsupported): Always use errc::function_not_supported instead of errc::not_supported. 2023-10-02 Tim Song Backported from master: 2023-09-28 Tim Song PR libstdc++/111050 * include/bits/hashtable_policy.h (_Hash_node_value_base<>::_M_valptr(), _Hash_node_value_base<>::_M_v()) Add [[__gnu__::__always_inline__]]. 2023-09-27 Jonathan Wakely Backported from master: 2023-08-09 Jonathan Wakely * include/experimental/bits/fs_path.h (path::string): Use _GLIBCXX17_CONSTEXPR not _GLIBCXX_CONSTEXPR for 'if constexpr'. * include/std/charconv (__to_chars_8): Initialize variable for C++17 constexpr rules. 2023-09-26 Jonathan Wakely Backported from master: 2023-09-25 Jonathan Wakely PR libstdc++/111511 PR c++/111512 * include/std/array (to_array): Qualify calls to __to_array. * testsuite/23_containers/array/creation/111512.cc: New test. 2023-09-18 Jonathan Wakely Backported from master: 2023-09-18 Jonathan Wakely * doc/xml/manual/configure.xml: Use conventional option name. * doc/xml/manual/status_cxx2020.xml: Update. * doc/html/*: Regenerate. 2023-09-14 Jonathan Wakely Backported from master: 2023-09-14 Jonathan Wakely PR c++/111357 * include/bits/utility.h (make_integer_sequence): Add cast. * testsuite/20_util/integer_sequence/pr111357.cc: New test. 2023-07-12 Jonathan Wakely Backported from master: 2023-07-12 Jonathan Wakely PR libstdc++/95048 * testsuite/27_io/filesystem/path/construct/95048.cc: Check conversions to wide strings. * testsuite/experimental/filesystem/path/construct/95048.cc: Likewise. 2023-07-06 Jonathan Wakely Backported from master: 2023-07-06 Jonathan Wakely PR libstdc++/104299 * doc/xml/manual/configure.xml: Describe stdio_pure argument to --enable-cstdio. * doc/html/manual/configure.html: Regenerate. 2023-06-23 Jonathan Wakely Backported from master: 2023-06-01 Jonathan Wakely * doc/xml/manual/evolution.xml: Document removal of implicit allocator rebinding extensions in strict mode and for C++20. * doc/html/*: Regenerate. 2023-06-21 Jason Merrill PR tree-optimization/105651 * include/bits/basic_string.tcc (_M_replace): Add an assert to avoid -Wrestrict false positive. 2023-05-30 Alexandre Oliva Backported from master: 2023-05-30 Alexandre Oliva * testsuite/20_util/from_chars/4.cc: Skip long double test06 on x86_64-vxworks. * testsuite/20_util/to_chars/long_double.cc: Xfail run on x86_64-vxworks. 2023-05-30 Alexandre Oliva Backported from master: 2023-05-25 Alexandre Oliva * testsuite/20_util/to_chars/long_double.cc: Expect execution fail on x86-vxworks. 2023-05-30 Alexandre Oliva Backported from master: 2023-05-05 Alexandre Oliva * testsuite/20_util/from_chars/4.cc: Skip long double test06 on aarch64-vxworks. * testsuite/20_util/to_chars/long_double.cc: Xfail run on aarch64-vxworks. 2023-05-30 Matthias Kretz Backported from master: 2023-05-30 Matthias Kretz PR libstdc++/109822 * include/experimental/bits/simd.h (to_native): Use int NTTP as specified in PTS2. (to_compatible): Likewise. Add missing tag to call mask generator ctor. * testsuite/experimental/simd/pr109822_cast_functions.cc: New test. 2023-05-30 Matthias Kretz Backported from master: 2023-05-30 Matthias Kretz * testsuite/experimental/simd/tests/integer_operators.cc: Compute expected value differently to avoid getting turned into a vector shift. 2023-05-30 Matthias Kretz Backported from master: 2023-05-30 Matthias Kretz * testsuite/experimental/simd/tests/operator_cvt.cc: Make long double <-> (u)long conversion tests conditional on sizeof(long double) and sizeof(long). 2023-05-30 Matthias Kretz Backported from master: 2023-05-26 Matthias Kretz * include/experimental/bits/simd_ppc.h (_S_bit_shift_left): Negative __y is UB, so prefer signed compare. 2023-05-24 Matthias Kretz Backported from master: 2023-05-24 Matthias Kretz PR libstdc++/109949 * include/experimental/bits/simd.h (__intrinsic_type): If __ALTIVEC__ is defined, map gnu::vector_size types to their corresponding __vector T types without losing unsignedness of integer types. Also prefer long long over long. * include/experimental/bits/simd_ppc.h (_S_popcount): Cast mask object to the expected unsigned vector type. 2023-05-24 Matthias Kretz Backported from master: 2023-05-24 Matthias Kretz PR libstdc++/109261 * include/experimental/bits/simd.h (__intrinsic_type): Specialize __intrinsic_type and __intrinsic_type in any case, but provide the member type only with __aarch64__. 2023-05-24 Matthias Kretz Backported from master: 2023-05-24 Matthias Kretz PR libstdc++/109261 * include/experimental/bits/simd_neon.h (_S_reduce): Add constexpr and make NEON implementation conditional on not __builtin_is_constant_evaluated. 2023-05-23 Matthias Kretz Backported from master: 2023-05-23 Matthias Kretz PR libstdc++/109261 * include/experimental/bits/simd.h (_SimdWrapper::_M_set): Avoid vector builtin subscripting in constant expressions. (resizing_simd_cast): Avoid memcpy if constant_evaluated. (const_where_expression, where_expression, where) (__extract_part, simd_mask, _SimdIntOperators, simd): Add either _GLIBCXX_SIMD_CONSTEXPR (on public APIs), or constexpr (on internal APIs). * include/experimental/bits/simd_builtin.h (__vector_permute) (__vector_shuffle, __extract_part, _GnuTraits::_SimdCastType1) (_GnuTraits::_SimdCastType2, _SimdImplBuiltin) (_MaskImplBuiltin::_S_store): Add constexpr. (_CommonImplBuiltin::_S_store_bool_array) (_SimdImplBuiltin::_S_load, _SimdImplBuiltin::_S_store) (_SimdImplBuiltin::_S_reduce, _MaskImplBuiltin::_S_load): Add constant_evaluated case. * include/experimental/bits/simd_fixed_size.h (_S_masked_load): Reword comment. (__tuple_element_meta, __make_meta, _SimdTuple::_M_apply_r) (_SimdTuple::_M_subscript_read, _SimdTuple::_M_subscript_write) (__make_simd_tuple, __optimize_simd_tuple, __extract_part) (__autocvt_to_simd, _Fixed::__traits::_SimdBase) (_Fixed::__traits::_SimdCastType, _SimdImplFixedSize): Add constexpr. (_SimdTuple::operator[], _M_set): Add constexpr and add constant_evaluated case. (_MaskImplFixedSize::_S_load): Add constant_evaluated case. * include/experimental/bits/simd_scalar.h: Add constexpr. * include/experimental/bits/simd_x86.h (_CommonImplX86): Add constexpr and add constant_evaluated case. (_SimdImplX86::_S_equal_to, _S_not_equal_to, _S_less) (_S_less_equal): Value-initialize to satisfy constexpr evaluation. (_MaskImplX86::_S_load): Add constant_evaluated case. (_MaskImplX86::_S_store): Add constexpr and constant_evaluated case. Value-initialize local variables. (_MaskImplX86::_S_logical_and, _S_logical_or, _S_bit_not) (_S_bit_and, _S_bit_or, _S_bit_xor): Add constant_evaluated case. * testsuite/experimental/simd/pr109261_constexpr_simd.cc: New test. 2023-05-23 Matthias Kretz Backported from master: 2023-05-22 Matthias Kretz * include/experimental/bits/simd_builtin.h (_S_fpclassify): Move __infn into #ifdef'ed block. * testsuite/experimental/simd/tests/fpclassify.cc: Declare constants only when used. * testsuite/experimental/simd/tests/frexp.cc: Likewise. * testsuite/experimental/simd/tests/logarithm.cc: Likewise. * testsuite/experimental/simd/tests/trunc_ceil_floor.cc: Likewise. * testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc: Move totest and expect1 into #ifdef'ed block. 2023-05-23 Matthias Kretz Backported from master: 2023-03-28 Matthias Kretz * include/experimental/bits/simd.h (is_simd_flag_type): New. (_IsSimdFlagType): New. (copy_from, copy_to, load ctors): Constrain _Flags using _IsSimdFlagType. 2023-05-23 Matthias Kretz Backported from master: 2023-03-28 Matthias Kretz * include/experimental/bits/simd_x86.h (_SimdImplX86): Use _Base::_S_divides if the optimized _S_divides function is hidden via the preprocessor. 2023-05-23 Matthias Kretz Backported from master: 2023-03-21 Matthias Kretz * include/experimental/bits/simd_detail.h: Don't declare the simd API as constexpr with Clang. * include/experimental/bits/simd_x86.h (__movm): New. (_S_blend_avx512): Resolve FIXME. Implement blend using __movm and ?:. (_SimdImplX86::_S_masked_unary): Clang does not implement the same builtins. Implement the function using __movm, ?:, and - operators on vector_size types instead. 2023-05-23 Matthias Kretz Backported from master: 2023-02-24 Matthias Kretz * include/experimental/bits/simd.h: Line breaks and indenting fixed to follow the libstdc++ standard. * include/experimental/bits/simd_builtin.h: Likewise. * include/experimental/bits/simd_fixed_size.h: Likewise. * include/experimental/bits/simd_neon.h: Likewise. * include/experimental/bits/simd_ppc.h: Likewise. * include/experimental/bits/simd_scalar.h: Likewise. * include/experimental/bits/simd_x86.h: Likewise. 2023-05-23 Matthias Kretz Backported from master: 2023-02-24 Matthias Kretz PR libstdc++/108030 * include/experimental/bits/simd_fixed_size.h (_SimdImplFixedSize::_S_broadcast): Replace inline with _GLIBCXX_SIMD_INTRINSIC. (_SimdImplFixedSize::_S_generate): Likewise. (_SimdImplFixedSize::_S_load): Likewise. (_SimdImplFixedSize::_S_masked_load): Likewise. (_SimdImplFixedSize::_S_store): Likewise. (_SimdImplFixedSize::_S_masked_store): Likewise. (_SimdImplFixedSize::_S_min): Likewise. (_SimdImplFixedSize::_S_max): Likewise. (_SimdImplFixedSize::_S_complement): Likewise. (_SimdImplFixedSize::_S_unary_minus): Likewise. (_SimdImplFixedSize::_S_plus): Likewise. (_SimdImplFixedSize::_S_minus): Likewise. (_SimdImplFixedSize::_S_multiplies): Likewise. (_SimdImplFixedSize::_S_divides): Likewise. (_SimdImplFixedSize::_S_modulus): Likewise. (_SimdImplFixedSize::_S_bit_and): Likewise. (_SimdImplFixedSize::_S_bit_or): Likewise. (_SimdImplFixedSize::_S_bit_xor): Likewise. (_SimdImplFixedSize::_S_bit_shift_left): Likewise. (_SimdImplFixedSize::_S_bit_shift_right): Likewise. (_SimdImplFixedSize::_S_remquo): Add inline keyword (to be explicit about not always-inline, yet). (_SimdImplFixedSize::_S_isinf): Likewise. (_SimdImplFixedSize::_S_isfinite): Likewise. (_SimdImplFixedSize::_S_isnan): Likewise. (_SimdImplFixedSize::_S_isnormal): Likewise. (_SimdImplFixedSize::_S_signbit): Likewise. 2023-05-23 Matthias Kretz Backported from master: 2023-02-24 Matthias Kretz PR libstdc++/108856 * include/experimental/bits/simd_builtin.h (_SimdImplBuiltin::_S_masked_unary): More efficient implementation of masked inc-/decrement for integers and floats without AVX2. * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_masked_unary): New. Use AVX512 masked subtract builtins for masked inc-/decrement. 2023-05-23 Matthias Kretz Backported from master: 2023-02-23 Matthias Kretz * testsuite/experimental/simd/tests/reductions.cc: Introduce max_distance as the type-dependent max error. 2023-05-23 Matthias Kretz Backported from master: 2023-02-23 Matthias Kretz PR libstdc++/108030 * include/experimental/bits/simd_detail.h (_GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA): Define as empty for __clang__. 2023-05-23 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz PR libstdc++/108030 * include/experimental/bits/simd_detail.h: Define _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA. * include/experimental/bits/simd.h: Annotate lambdas with _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA. * include/experimental/bits/simd_builtin.h: Ditto. * include/experimental/bits/simd_converter.h: Ditto. * include/experimental/bits/simd_fixed_size.h: Ditto. * include/experimental/bits/simd_math.h: Ditto. * include/experimental/bits/simd_neon.h: Ditto. * include/experimental/bits/simd_x86.h: Ditto. 2023-05-16 Jonathan Wakely Backported from master: 2022-11-28 Jonathan Wakely PR libstdc++/107801 * src/c++17/memory_resource.cc (chunk::_M_bytes): Change type from uint32_t to bitset::size_type. Adjust static assertion. (__pool_resource::_Pool::replenish): Cast to size_t after multiplication instead of before. (__pool_resource::_M_alloc_pools): Ensure both arguments to std::max have type size_t. 2023-05-11 Jonathan Wakely Backported from master: 2022-11-16 Jonathan Wakely * python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Make expansion of std::string in manager name more robust. 2023-05-08 Release Manager * GCC 12.3.0 released. 2023-05-03 Kefu Chai Backported from master: 2023-05-03 Kefu Chai Jonathan Wakely PR libstdc++/109703 * include/bits/basic_string.h (basic_string(Iter, Iter, Alloc)): Initialize _M_string_length. 2023-05-03 Jonathan Wakely Backported from master: 2023-04-28 Jonathan Wakely * doc/doxygen/user.cfg.in (STRIP_FROM_PATH): Remove prefixes from header paths. 2023-04-29 Patrick Palka Backported from master: 2023-04-12 Patrick Palka * include/std/ranges (lazy_split_view::_OuterIter::_OuterIter): Propagate _M_trailing_empty in the const-converting constructor as per LWG 3904. * testsuite/std/ranges/adaptors/lazy_split.cc (test12): New test. 2023-04-29 Patrick Palka Backported from master: 2023-03-14 Patrick Palka * include/bits/stl_iterator.h (move_iterator::_S_iter_concept): Define. (__cpp_lib_move_iterator_concept): Define for C++20. (move_iterator::iterator_concept): Strengthen as per P2520R0. * include/std/version (__cpp_lib_move_iterator_concept): Define for C++20. * testsuite/24_iterators/move_iterator/p2520r0.cc: New test. 2023-04-29 Patrick Palka Backported from master: 2023-03-09 Patrick Palka PR libstdc++/108362 * include/std/ranges (__detail::__can_single_view): New concept. (_Single::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. (__detail::__can_iota_view): New concept. (_Iota::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. (__detail::__can_istream_view): New concept. (_Istream::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. * testsuite/std/ranges/iota/lwg3292_neg.cc: Prune "in requirements" diagnostic. * testsuite/std/ranges/iota/iota_view.cc (test07): New test. * testsuite/std/ranges/istream_view.cc (test08): New test. * testsuite/std/ranges/single_view.cc (test07): New test. 2023-04-28 Patrick Palka Backported from master: 2023-04-24 Patrick Palka * include/bits/max_size_type.h (__max_diff_type::operator>>=): Fix propagation of sign bit. * testsuite/std/ranges/iota/max_size_type.cc: Avoid using the non-standard 'signed typedef-name'. Add some compile-time tests for right-shifting a negative __max_diff_type value by more than one. 2023-04-27 Jonathan Wakely * include/std/atomic: Add missing @endcond doxygen comment. 2023-04-27 Jonathan Wakely Backported from master: 2022-11-25 Jonathan Wakely PR libstdc++/107850 * include/bits/erase_if.h (__erase_nodes_if): Use non-const reference to the container. * include/experimental/map (erase_if): Likewise. * include/experimental/set (erase_if): Likewise. * include/experimental/unordered_map (erase_if): Likewise. * include/experimental/unordered_set (erase_if): Likewise. * include/std/map (erase_if): Likewise. * include/std/set (erase_if): Likewise. * include/std/unordered_map (erase_if): Likewise. * include/std/unordered_set (erase_if): Likewise. * testsuite/23_containers/map/erasure.cc: Check with const-incorrect predicate. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/experimental/map/erasure.cc: Likewise. * testsuite/experimental/set/erasure.cc: Likewise. * testsuite/experimental/unordered_map/erasure.cc: Likewise. * testsuite/experimental/unordered_set/erasure.cc: Likewise. 2023-04-27 Jonathan Wakely Backported from master: 2022-11-28 Jonathan Wakely * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: Replace non-ASCII character. 2023-04-27 Jonathan Wakely Backported from master: 2023-02-28 Jonathan Wakely PR libstdc++/108952 * include/bits/uses_allocator_args.h (uses_allocator_construction_args): Implement LWG 3527. * testsuite/20_util/pair/astuple/get-2.cc: New test. * testsuite/20_util/scoped_allocator/108952.cc: New test. * testsuite/20_util/uses_allocator/lwg3527.cc: New test. 2023-04-27 Jonathan Wakely Backported from master: 2023-03-31 Jonathan Wakely PR libstdc++/109339 * include/std/stop_token (_Stop_state_ptr(const stop_source&)): Add attribute access with access-mode 'none'. * testsuite/30_threads/stop_token/stop_source/109339.cc: New test. 2023-04-27 Jonathan Wakely Backported from master: 2022-11-28 Jonathan Wakely PR libstdc++/107466 * include/bits/random.h (subtract_with_carry_engine): Use 32-bit type for default seed. Use 0u as default argument for subtract_with_carry_engine(result_type) constructor and seed(result_type) member function. * include/bits/random.tcc (subtract_with_carry_engine): Use 32-bit type for default seed and engine used for initial state. * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: New test. 2023-04-27 Jonathan Wakely Backported from master: 2023-04-27 Jonathan Wakely * include/bits/mofunc_impl.h: Fix typo in doxygen comment. 2023-04-27 Jonathan Wakely Backported from master: 2023-04-27 Jonathan Wakely * doc/doxygen/user.cfg.in (SOURCE_BROWSER): Only set to YES for HTML docs. * include/bits/gslice_array.h (_DEFINE_VALARRAY_OPERATOR): Omit from doxygen docs. * include/bits/indirect_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/bits/mask_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/bits/slice_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/std/valarray (_DEFINE_VALARRAY_UNARY_OPERATOR) (_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT) (_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT) (_DEFINE_BINARY_OPERATOR): Likewise. 2023-04-21 Jonathan Wakely PR libstdc++/103755 * include/bits/locale_classes.tcc (try_facet, use_facet): Do not check array index or dynamic type when accessing required specializations of std::ctype, std::num_get, or std::num_put. * testsuite/22_locale/ctype/is/string/89728_neg.cc: Adjust expected errors. 2023-04-20 Jonathan Wakely Backported from master: 2022-11-29 Jonathan Wakely PR libstdc++/107852 PR libstdc++/106199 PR libstdc++/100366 * include/bits/vector.tcc (vector::_M_fill_insert): Copy _M_start and _M_finish members before allocating. (vector::_M_default_append): Likewise. (vector::_M_range_insert): Likewise. 2023-04-20 Jonathan Wakely Backported from master: 2023-04-04 Jonathan Wakely * doc/xml/manual/extensions.xml: Remove std::bad_exception from example program. * doc/html/manual/ext_demangling.html: Regenerate. 2023-04-20 Jonathan Wakely Backported from master: 2023-04-05 Jonathan Wakely * include/bits/regex.h (sub_match::swap): New function. * testsuite/28_regex/sub_match/lwg3204.cc: New test. 2023-04-20 Jonathan Wakely Backported from master: 2023-03-28 Jonathan Wakely PR libstdc++/103387 * include/bits/istream.tcc (istream::_M_extract(ValueT&)): Use std::use_facet instead of cached _M_num_get facet. (istream::operator>>(short&)): Likewise. (istream::operator>>(int&)): Likewise. * include/bits/ostream.tcc (ostream::_M_insert(ValueT)): Use std::use_facet instead of cached _M_num_put facet. 2023-04-20 Jonathan Wakely Backported from master: 2023-01-15 Jonathan Wakely * testsuite/30_threads/jthread/jthread.cc: Remove -pthread from dg-options. 2023-04-20 Jonathan Wakely Backported from master: 2023-03-22 Jonathan Wakely * include/bits/shared_ptr_atomic.h (atomic::operator=(nullptr_t)): Add overload, as per LWG 3893. * testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: Check assignment from nullptr. 2023-04-20 Jonathan Wakely Backported from master: 2023-03-29 Jonathan Wakely * include/std/expected (expected::value() &): Use const lvalue for unex member passed to bad_expected_access constructor, as per LWG 3843. 2023-04-20 Jonathan Wakely Backported from master: 2023-02-02 Jonathan Wakely * include/std/variant (variant::operator=): Implement resolution of LWG 3585. * testsuite/20_util/variant/lwg3585.cc: New test. 2023-04-12 Patrick Palka Backported from master: 2023-04-12 Patrick Palka * src/c++17/floating_from_chars.cc: Include , , and . 2023-03-30 Jonathan Wakely Backported from master: 2023-03-29 Jonathan Wakely PR libstdc++/109242 * include/std/optional (transform): Use std::remove_cv_t. * testsuite/20_util/optional/monadic/pr109242.cc: New test. 2023-03-28 Jonathan Wakely Backported from master: 2022-12-16 Jonathan Wakely PR libstdc++/108118 * include/bits/shared_ptr_base.h (weak_ptr::operator=): Implement as move-and-swap exactly as specified in the standard. * testsuite/20_util/weak_ptr/cons/self_move.cc: New test. 2023-03-28 Jonathan Wakely Backported from master: 2022-11-03 Jonathan Wakely * include/bits/ranges_algobase.h (__detail::__copy_or_move): Move output iterator. * testsuite/25_algorithms/copy/constrained.cc: Check copying to move-only output iterator. 2023-03-28 Björn Schäpers Backported from master: 2023-01-14 Björn Schäpers * include/std/stacktrace (stacktrace_entry::_S_demangle): Use raw __name if __cxa_demangle could not demangle it. 2023-03-28 Jonathan Wakely Backported from master: 2022-12-12 Jonathan Wakely * include/std/stacktrace (operator<<): Only output to narrow ostreams (LWG 3515). * testsuite/19_diagnostics/stacktrace/synopsis.cc: 2023-03-28 Jonathan Wakely Backported from master: 2022-12-09 Jonathan Wakely * include/bits/chrono.h (duration_cast, floor, round, abs, ceil) (time_point_cast): Add [[nodiscard]] attribute and doxygen comments. (treat_as_floating_point): Add doxygen commen. 2023-03-28 Jonathan Wakely Backported from master: 2022-12-09 Jonathan Wakely * include/bits/chrono.h (duration, time_point): Change 'struct' to 'class'. 2023-03-28 Jonathan Wakely Backported from master: 2023-01-26 Jonathan Wakely PR libstdc++/108554 * include/bits/stl_tree.h (_Rb_tree_insert_and_rebalance): Add nonnull attribute. (_Rb_tree_rebalance_for_erase): Add nonnull and returns_nonnull attributes. * testsuite/23_containers/map/modifiers/108554.cc: New test. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-23 Jonathan Wakely * include/std/bitset (bitset::_M_copy_to_string): Find set bits instead of iterating over individual bits. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-15 Jonathan Wakely * include/bits/shared_ptr_atomic.h (_GLIBCXX_TSAN_MUTEX_PRE_LOCK): Replace with ... (_GLIBCXX_TSAN_MUTEX_TRY_LOCK): ... this, add try_lock flag. (_GLIBCXX_TSAN_MUTEX_TRY_LOCK_FAILED): New macro using try_lock_failed flag (_GLIBCXX_TSAN_MUTEX_POST_LOCK): Rename to ... (_GLIBCXX_TSAN_MUTEX_LOCKED): ... this. (_GLIBCXX_TSAN_MUTEX_PRE_UNLOCK): Remove invalid flag. (_GLIBCXX_TSAN_MUTEX_POST_UNLOCK): Remove invalid flag. (_Sp_atomic::_Atomic_count::lock): Use new macros. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-14 Jonathan Wakely * include/bits/shared_ptr_atomic.h (_GLIBCXX_TSAN_MUTEX_DESTROY) (_GLIBCXX_TSAN_MUTEX_PRE_LOCK, _GLIBCXX_TSAN_MUTEX_POST_LOCK) (_GLIBCXX_TSAN_MUTEX_PRE_UNLOCK, _GLIBCXX_TSAN_MUTEX_POST_UNLOCK) (_GLIBCXX_TSAN_MUTEX_PRE_SIGNAL, _GLIBCXX_TSAN_MUTEX_POST_SIGNAL): Define macros for TSan annotation functions. (_Sp_atomic::_Atomic_count): Add annotations. 2023-03-28 Jonathan Wakely Backported from master: 2022-05-17 Jonathan Wakely * include/std/memory_resource (new_delete_resource): Add nodiscard, returns_nonnull and const attributes. (null_memory_resource): Likewise. (set_default_resource, get_default_resource): Add returns_nonnull attribute. (memory_resource::is_equal): Add nodiscard attribute. (operator==, operator!=): Likewise. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-14 Jonathan Wakely * include/std/future (_State_baseV2::__setter(exception_ptr&, promise&)): Add assertion for LWG 2276 precondition. * testsuite/30_threads/promise/members/set_exception_neg.cc: New test. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-08 Jonathan Wakely * include/c_global/cstddef (byte): Add always_inline attribute to all operator overloads. (to_integer): Add always_inline attribute. 2023-03-28 Jonathan Wakely Backported from master: 2022-09-08 Jonathan Wakely * include/std/system_error (__adl_only::make_error_code): Add deleted function. (__adl_only::make_error_condition): Likewise. (error_code::error_code(ErrorCodeEnum)): Add using-declaration for deleted function. (error_condition::error_condition(ErrorConditionEnum)): Likewise. * testsuite/19_diagnostics/error_code/cons/lwg3629.cc: New test. * testsuite/19_diagnostics/error_condition/cons/lwg3629.cc: New test. 2023-03-28 Jonathan Wakely Backported from master: 2022-05-17 Jonathan Wakely * include/bits/ios_base.h (io_category): Add const and nodiscard attributes. (make_error_code, make_error_condition): Add nodiscard. * include/std/future (future_category): Add const and nodiscard. (make_error_code, make_error_condition): Add nodiscard. * include/std/system_error (generic_category system_category): Add nodiscard. Replace _GLIBCXX_CONST with C++11 attribute. (error_code::value, error_code::category, error_code::operator bool) (error_condition::value, error_condition::category) (error_condition::operator bool, make_error_code) (make_error_condition, operator==, operator!=, operator<=>): Add nodiscard. 2023-03-28 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/bits/std_thread.h (thread, thread::id): Improve doxygen docs. * include/std/future: Likewise. * include/std/thread (jthread): Likewise. 2023-03-28 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/std/system_error: Improve doxygen comments. 2023-03-28 Jonathan Wakely Backported from master: 2023-02-16 Jonathan Wakely * include/ext/throw_allocator.h: Use reserved names for parameters. 2023-03-28 Jonathan Wakely Backported from master: 2022-11-25 Jonathan Wakely * acinclude.m4 (GLIBCXX_CHECK_UCHAR_H): Don't use AC_MSG_RESULT unless the AC_MSG_CHECKING happened. * configure: Regenerate. 2023-03-28 Jonathan Wakely Backported from master: 2023-01-12 Jonathan Wakely * doc/xml/manual/abi.xml: Add latest library versions. * doc/html/manual/abi.html: Regenerate. 2023-03-28 Jonathan Wakely Backported from master: 2023-03-28 Jonathan Wakely * include/bits/char_traits.h (char_traits::copy): Return without using memcpy if n==0. (char_traits::assign): Likewise for memset. 2023-03-28 Jonathan Wakely Backported from master: 2023-03-28 Jonathan Wakely PR libstdc++/109299 * include/bits/basic_string.h (basic_string::_M_is_local()): Add hint for compiler that local strings fit in the local buffer. 2023-03-28 Jonathan Wakely Backported from master: 2023-03-01 Jonathan Wakely * include/bits/cow_string.h: Fix typo in comment. 2023-03-28 Jonathan Wakely Backported from master: 2023-02-16 Jonathan Wakely * include/experimental/optional: Fix header name in comment. 2023-03-28 Jonathan Wakely Backported from master: 2023-01-16 Jonathan Wakely PR libstdc++/108413 * include/c_compatibility/stdatomic.h: Change copyright line to be consistent with other headers contributed under DCO terms. * include/std/expected: Add full stop to copyright line. 2023-03-21 Matthias Kretz Backported from master: 2023-03-21 Matthias Kretz * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0 with __RECIPROCAL_MATH__. 2023-03-21 Matthias Kretz Backported from master: 2023-03-21 Matthias Kretz * include/experimental/bits/simd_detail.h: Don't define _GLIBCXX_SIMD_WORKAROUND_PR90993 for Clang. * include/experimental/bits/simd_x86.h (_S_divides): Remove check for __clang__. 2023-03-21 Matthias Kretz Backported from master: 2023-03-21 Matthias Kretz * testsuite/experimental/simd/tests/operators.cc: Clang doesn't define __GCC_IEC_559. Use __STDC_IEC_559__ instead. 2023-03-20 François Dumont Backported from master: 2022-11-16 François Dumont * python/libstdcxx/v6/printers.py (FilteringTypePrinter): Rename 'match' field 'template'. Add self.targ1 to specify the first template parameter of the instantiation to match. (add_one_type_printer): Add targ1 optional parameter, default to None. Use gdb.types.get_basic_type to compare the type to recognize and the type returned from the typedef lookup. (register_type_printers): Adapt calls to add_one_type_printers. 2023-03-20 François Dumont Backported from master: 2022-10-03 François Dumont * python/libstdcxx/v6/printers.py (Printer.add_version): Do not add version namespace for __cxx11 symbols. (add_one_template_type_printer): Likewise. (add_one_type_printer): Likewise. (FilteringTypePrinter._recognizer.recognize): Add a workaround for std::string & al ambiguous typedef matching both std:: and std::__cxx11:: symbols. * testsuite/libstdc++-prettyprinters/cxx17.cc: Remove obsolete \#define _GLIBCXX_USE_CXX11_ABI 0. * testsuite/libstdc++-prettyprinters/simple.cc: Likewise. Adapt test to accept std::__cxx11::list. * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise. * testsuite/libstdc++-prettyprinters/whatis.cc: Likewise. * testsuite/libstdc++-prettyprinters/80276.cc: Likewise and remove xfail for c++20 and debug mode. * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise. 2023-03-20 François Dumont Backported from master: 2022-09-22 François Dumont * python/libstdcxx/v6/printers.py: Remove ptinter registration for non-existing types std::__debug::unique_ptr, std::__debug::stack, std::__debug::queue, std::__debug::priority_queue. 2023-03-20 Jonathan Wakely Backported from master: 2023-03-10 Jonathan Wakely PR libstdc++/109064 * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker): Remove self-recursion in __init__. Add missing _supports. * testsuite/libstdc++-xmethods/shared_ptr.cc: Check use_count() and unique(). 2023-03-20 Jonathan Wakely PR libstdc++/109182 * include/std/expected (expected::expected(in_place_t)): Remove template-head. 2023-03-20 Jonathan Wakely PR libstdc++/109165 * include/std/coroutine (hash<>::operator()): Add const. * testsuite/18_support/coroutines/hash.cc: New test. 2023-03-10 Thomas W Rodgers Backported from master: 2023-02-14 Thomas W Rodgers PR libstdc++/103934 * include/std/atomic (atomic_flag_wait): Add. (atomic_flag_wait_explicit): Add. (atomic_flag_notify): Add. (atomic_flag_notify_explicit): Add. * testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Add test case to cover missing atomic_flag free functions. 2023-02-23 Matthias Kretz Backported from master: 2023-02-23 Matthias Kretz PR libstdc++/108030 * include/experimental/bits/simd.h (__vector_broadcast): Implement via __vector_broadcast_impl instead of __call_with_n_evaluations + 2 lambdas. (__vector_broadcast_impl): New. 2023-02-23 Matthias Kretz Backported from master: 2023-02-23 Matthias Kretz * include/experimental/bits/simd_builtin.h (_S_set): Compare as int. The actual range of these indexes is very small. 2023-02-23 Matthias Kretz Backported from master: 2023-02-23 Matthias Kretz * include/experimental/bits/simd_x86.h (_S_bit_shift_left) (_S_bit_shift_right): Declare constexpr. The implementation was already expecting constexpr evaluation. 2023-02-23 Matthias Kretz Backported from master: 2023-02-20 Matthias Kretz * include/experimental/bits/simd.h (__extract_part, split): Use reserved name for template parameter. 2023-02-21 Jonathan Wakely Backported from master: 2022-08-31 Jonathan Wakely * include/bits/refwrap.h (reference_wrapper::operator()): Add noexcept-specifier and use __invoke_result instead of result_of. * testsuite/20_util/reference_wrapper/invoke-noexcept.cc: New test. 2023-02-21 Jonathan Wakely Backported from master: 2023-02-02 Jonathan Wakely PR libstdc++/108636 * include/bits/fs_path.h (path::path(string_view, _Type)) (path::_Cmpt::_Cmpt(string_view, _Type, size_t)): Move inline definitions to ... * src/c++17/fs_path.cc: ... here. * testsuite/27_io/filesystem/path/108636.cc: New test. 2023-02-16 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz * include/experimental/bits/simd_math.h (__hypot): Bitcasting between scalars requires the __bit_cast helper function instead of simd_bit_cast. 2023-02-16 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_not_equal_to, _SimdImplX86::_S_less) (_SimdImplX86::_S_less_equal): Do not call __builtin_is_constant_evaluated in constexpr-if. 2023-02-16 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz * testsuite/experimental/simd/tests/bits/verify.h (verify::verify): Use %zx for size_t in format string. 2023-02-16 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz * testsuite/experimental/simd/README.md: Document the timeout and timeout-factor directives. Minor typo fixed. 2023-02-16 Matthias Kretz Backported from master: 2023-02-16 Matthias Kretz * include/experimental/bits/simd.h (_SimdWrapper::_M_is_constprop_none_of) (_SimdWrapper::_M_is_constprop_all_of): Return false unless the computed result still satisfies __builtin_constant_p. 2023-02-14 Thomas W Rodgers Backported from master: 2023-02-14 Thomas W Rodgers PR libstdc++/103934 * include/std/atomic (atomic_flag_test): Add. (atomic_flag_test_explicit): Add. * testsuite/29_atomics/atomic_flag/test/explicit.cc: Add test case to cover missing atomic_flag free functions. * testsuite/29_atomics/atomic_flag/test/implicit.cc: Likewise. 2023-02-10 Jakub Jelinek Backported from master: 2022-11-24 Jakub Jelinek PR libstdc++/107468 * src/c++17/fast_float/fast_float.h: Partial merge from fast_float 2ef9abbcf6a11958b6fa685a89d0150022e82e78 commit. 2023-02-10 Jakub Jelinek Backported from master: 2022-11-07 Jakub Jelinek PR libstdc++/107468 * src/c++17/fast_float/fast_float.h: Partial merge from fast_float 662497742fea7055f0e0ee27e5a7ddc382c2c38e commit. * testsuite/20_util/from_chars/pr107468.cc: New test. 2023-02-02 Jonathan Wakely Backported from master: 2023-02-01 Jonathan Wakely * src/c++11/random.cc (random_device::_M_fini): Do not try to close the file handle if the target doesn't support the /dev/random and /dev/urandom files. 2023-02-02 Jonathan Wakely Backported from master: 2023-02-01 Jonathan Wakely * config/os/generic/error_constants.h (errc::value_too_large) [__AVR__]: Define. * src/c++11/system_error.cc (system_category::default_error_condition) [__AVR__]: Only match recognize values equal to EDOM, ERANGE, ENOSYS and EINTR. * src/c++17/fs_ops.cc (fs::current_path) [__AVR__]: Do not check for ENOENT etc. in switch. (fs::remove_all) [__AVR__]: Likewise. * src/filesystem/ops-common.h [__AVR__]: Do not use POSIX open, close etc. 2023-02-02 Patrick Palka Backported from master: 2022-11-06 Patrick Palka * include/bits/atomic_wait.h (_detail::__platform_wait_alignment): Declare inline. Remove redundant static specifier. (__detail::__atomic_spin_count_relax): Declare inline. (__detail::__atomic_spin_count): Likewise. * include/bits/regex_automaton.h (__detail::_S_invalid_state_id): Declare inline for C++17. Declare constexpr. Remove redundant const and static specifiers. * include/bits/regex_error.h (regex_constants::error_collate): Declare inline for C++17 as per P0607R0. (regex_constants::error_ctype): Likewise. (regex_constants::error_escape): Likewise. (regex_constants::error_backref): Likewise. (regex_constants::error_brack): Likewise. (regex_constants::error_paren): Likewise. (regex_constants::error_brace): Likewise. (regex_constants::error_badbrace): Likewise. (regex_constants::error_range): Likewise. (regex_constants::error_space): Likewise. (regex_constants::error_badrepeat): Likewise. (regex_constants::error_complexity): Likewise. (regex_constants::error_stack): Likewise. * include/ext/concurrence.h (__gnu_cxx::__default_lock_policy): Likewise. Remove redundant static specifier. * include/pstl/execution_defs.h (execution::seq): Declare inline for C++17 as per P0607R0. (execution::par): Likewise. (execution::par_unseq): Likewise. (execution::unseq): Likewise. 2023-01-18 Jonathan Wakely Backported from master: 2022-12-22 Jonathan Wakely PR libstdc++/105730 * src/c++11/compatibility-condvar.cc (__nothrow_wait_cv::wait): Access private data member of base class and call its wait member. 2023-01-16 Jonathan Wakely Backported from master: 2022-08-04 Jonathan Wakely PR libstdc++/106183 * include/bits/atomic_wait.h (__waiter_pool_base::_M_notify): Move increment of _M_ver here. [!_GLIBCXX_HAVE_PLATFORM_WAIT]: Lock mutex around increment. Use relaxed memory order and always notify all waiters. (__waiter_base::_M_do_wait) [!_GLIBCXX_HAVE_PLATFORM_WAIT]: Check value again after locking mutex. (__waiter_base::_M_notify): Remove increment of _M_ver. 2023-01-05 Jonathan Wakely Backported from master: 2023-01-05 Jonathan Wakely PR libstdc++/108265 * include/std/chrono (hh_mm_ss): Do not use chrono::abs if duration rep is unsigned. Remove incorrect noexcept-specifier. * testsuite/std/time/hh_mm_ss/1.cc: Check unsigned rep. Check floating-point representations. Check default construction. 2022-12-21 Jonathan Wakely Backported from master: 2022-11-23 Jonathan Wakely PR libstdc++/107814 * testsuite/experimental/filesystem/iterators/error_reporting.cc: Use a static buffer with space after it. 2022-12-21 Jonathan Wakely Backported from master: 2022-12-16 Jonathan Wakely * include/std/expected (expected::_M_swap_val_unex): Guard the correct object. (expected::swap): Move is_swappable requirement from static_assert to constraint. (swap): Likewise. (operator==): Remove noexcept-specifier. * testsuite/20_util/expected/swap.cc: Check swapping of types without non-throwing move constructor. Check constraints on swap. * testsuite/20_util/expected/unexpected.cc: Check constraints on swap. * testsuite/20_util/expected/equality.cc: New test. 2022-12-14 Jonathan Wakely Backported from master: 2022-12-14 Jonathan Wakely PR libstdc++/108097 * include/std/stacktrace (basic_stracktrace::_Impl): Do not multiply N by sizeof(value_type) when allocating. 2022-11-24 Jonathan Wakely Backported from master: 2022-09-15 Jonathan Wakely * include/std/memory: Do not include . 2022-11-24 Jonathan Wakely Backported from master: 2022-11-11 Jonathan Wakely * testsuite/20_util/tuple/swap.cc (MoveOnly::operator==): Add const qualifier. * testsuite/26_numerics/valarray/87641.cc (X::operator==): Likewise. 2022-11-24 Jonathan Wakely Backported from master: 2022-11-02 Jonathan Wakely * include/std/expected (expected::_M_invalid): Remove. 2022-11-24 Jonathan Wakely Backported from master: 2022-11-21 Jonathan Wakely * include/bits/chrono.h (duration): Check preconditions on template arguments before using them. 2022-11-24 Jonathan Wakely Backported from master: 2022-10-28 Jonathan Wakely * include/bits/fs_path.h (path::filename()): Fix dangling reference. 2022-11-24 Jonathan Wakely Backported from master: 2022-09-14 Jonathan Wakely * doc/xml/manual/intro.xml: Document LWG 1203. * doc/html/*: Regenerate. 2022-11-24 Jonathan Wakely Backported from master: 2022-09-07 Jonathan Wakely * include/std/barrier: Add missing runtime exception. 2022-11-24 Jonathan Wakely Backported from master: 2022-08-04 Jonathan Wakely * include/bits/fs_dir.h (directory_iterator): Add comparison with std::default_sentinel_t. Remove redundant operator!= for C++20. * (recursive_directory_iterator): Likewise. * include/bits/iterator_concepts.h [!__cpp_lib_concepts] (default_sentinel_t, default_sentinel): Define even if concepts are not supported. * include/bits/regex.h (regex_iterator): Add comparison with std::default_sentinel_t. Remove redundant operator!= for C++20. (regex_token_iterator): Likewise. (regex_token_iterator::_M_end_of_seq()): Add noexcept. * testsuite/27_io/filesystem/iterators/lwg3719.cc: New test. * testsuite/28_regex/iterators/regex_iterator/lwg3719.cc: New test. * testsuite/28_regex/iterators/regex_token_iterator/lwg3719.cc: New test. 2022-11-24 Jonathan Wakely Backported from master: 2022-09-23 Jonathan Wakely PR libstdc++/91456 * include/std/type_traits (__is_nothrow_invocable): Remove. (__is_invocable_impl::__nothrow_type): New member type which checks if the conversion can throw. (__is_nt_invocable_impl): Replace class template with alias template to __is_nt_invocable_impl::__nothrow_type. * testsuite/20_util/is_nothrow_invocable/91456.cc: New test. * testsuite/20_util/is_nothrow_convertible/value.cc: Remove macro used by value_ext.cc test. * testsuite/20_util/is_nothrow_convertible/value_ext.cc: Remove test for non-standard __is_nothrow_invocable trait. 2022-11-22 Jonathan Wakely PR libstdc++/106201 * include/bits/fs_path.h (filesystem::swap(path&, path&)): Replace with abbreviated function template. * include/experimental/bits/fs_path.h (filesystem::swap): Likewise. * testsuite/27_io/filesystem/iterators/106201.cc: New test. * testsuite/experimental/filesystem/iterators/106201.cc: New test. 2022-11-22 Jonathan Wakely Backported from master: 2022-11-22 Jonathan Wakely PR libstdc++/107801 * src/c++17/memory_resource.cc (pool_sizes): Disable large pools for targets with 16-bit int. 2022-11-14 Jonathan Wakely * include/bits/mofunc_impl.h (move_only_function::__param_t): Use __is_scalar instead of is_trivially_copyable. * testsuite/20_util/move_only_function/call.cc: Check parameters involving incomplete types. 2022-11-14 Jonathan Wakely Backported from master: 2022-11-11 Jonathan Wakely PR libstdc++/95048 * include/bits/fs_path.h (path::_Codecvt): New class template that selects the kind of code conversion done. (path::_Codecvt): Select based on sizeof(wchar_t). (_GLIBCXX_CONV_FROM_UTF8): New macro to allow the same code to be used for Windows and POSIX. (path::_S_convert(const EcharT*, const EcharT*)): Simplify by using _Codecvt and _GLIBCXX_CONV_FROM_UTF8 abstractions. (path::_S_str_convert(basic_string_view, const A&)): Simplify nested conditions. * include/experimental/bits/fs_path.h (path::_Cvt): Define nested typedef controlling type of code conversion done. (path::_Cvt::_S_wconvert): Use new typedef. (path::string(const A&)): Likewise. * testsuite/27_io/filesystem/path/construct/95048.cc: New test. * testsuite/experimental/filesystem/path/construct/95048.cc: New test. 2022-11-14 Nathaniel Shead Backported from master: 2022-11-11 Nathaniel Shead PR libstdc++/103295 * include/bits/basic_string.h (_M_use_local_data): Set active member to _M_local_buf. 2022-11-08 Jonathan Wakely Backported from master: 2022-11-08 Jonathan Wakely * doc/xml/authors.xml: Remove empty author element. * doc/xml/manual/spine.xml: Likewise. * doc/html/manual/index.html: Regenerate. 2022-10-19 Alexandre Oliva Backported from master: 2022-06-22 Alexandre Oliva * libsupc++/eh_globals.cc [!_GLIBCXX_HAVE_TLS] (__eh_globals_init::~__eh_globals_init): Clear _S_init first. 2022-09-29 Jonathan Wakely Backported from master: 2022-09-28 Jonathan Wakely * doc/xml/manual/evolution.xml: Document std::bind API changes. * doc/xml/manual/intro.xml: Document LWG 2487 status. * doc/xml/manual/using.xml: Clarify default value of _GLIBCXX_USE_DEPRECATED. * doc/html/*: Regenerate. * include/std/functional (_Bind::operator()(Args&&...) volatile) (_Bind::operator()(Args&&...) const volatile) (_Bind_result::operator()(Args&&...) volatile) (_Bind_result::operator()(Args&&...) const volatile): Replace with deleted overload for C++20 and later. * testsuite/20_util/bind/cv_quals.cc: Check for deprecated warnings in C++17. * testsuite/20_util/bind/cv_quals_2.cc: Likewise, and check for ill-formed in C++20. 2022-09-16 Jonathan Wakely * doc/xml/manual/abi.xml: Document GLIBCXX_3.4.30 version. * doc/html/manual/abi.html: Regenerate. 2022-09-12 Patrick Palka Backported from master: 2022-09-12 Patrick Palka PR libstdc++/106320 * testsuite/std/ranges/adaptors/join.cc (test13): New test. 2022-09-07 Jonathan Wakely Backported from master: 2022-08-22 Jonathan Wakely PR libstdc++/106695 * include/bits/std_thread.h (thread::_State_impl): Forward individual arguments to _Invoker constructor. (thread::_Invoker): Add constructor. Delete copies. * include/std/future (__future_base::_Deferred_state): Forward individual arguments to _Invoker constructor. (__future_base::_Async_state_impl): Likewise. * testsuite/30_threads/async/106695.cc: New test. * testsuite/30_threads/thread/106695.cc: New test. 2022-09-07 Jonathan Wakely Backported from master: 2022-08-22 Jonathan Wakely PR libstdc++/106607 * include/bits/regex_compiler.tcc (_Compiler::_M_cur_int_value): Use built-ins to check for integer overflow in back-reference number. * testsuite/28_regex/basic_regex/106607.cc: New test. 2022-08-24 Jonathan Wakely Backported from master: 2022-08-23 Jonathan Wakely PR libstdc++/106589 * include/std/variant (__do_visit): Handle is_void for zero argument case. * testsuite/20_util/variant/visit_r.cc: Check std::visit(v). 2022-08-23 Jonathan Wakely Backported from master: 2022-08-22 Jonathan Wakely PR libstdc++/105678 * doc/xml/manual/using.xml: Document -lstdc++_libbacktrace requirement for using std::stacktrace. Also adjust -frtti and -fexceptions to document non-default (i.e. negative) forms. * doc/html/*: Regenerate. 2022-08-19 Release Manager * GCC 12.2.0 released. 2022-08-05 Jonathan Wakely Backported from master: 2022-08-04 Jonathan Wakely * include/std/string_view (basic_string_view(Range&&)): Add explicit as per P2499R0. * testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: Adjust implicit conversions. Check implicit conversions fail. * testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: Likewise. 2022-08-05 Jonathan Wakely Backported from master: 2022-08-04 Jonathan Wakely * include/std/expected (unexpected::_M_val): Rename to _M_unex. (bad_expected_access::_M_val): Likewise. 2022-08-05 Jonathan Wakely Backported from master: 2022-08-04 Jonathan Wakely * include/bits/ios_base.h (__cpp_lib_ios_noreplace): Update value to 202207L. * include/std/version (__cpp_lib_ios_noreplace): Likewise. * testsuite/27_io/basic_ofstream/open/char/noreplace.cc: Check for new value. * testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc: Likewise. 2022-08-03 Jonathan Wakely Backported from master: 2022-06-28 Jonathan Wakely * src/c++17/fs_dir.cc (_Dir::dir_and_pathname):: Replace with current() returning _At_path. (_Dir::_Dir, _Dir::open_subdir, _Dir::do_unlink): Adjust. * src/filesystem/dir-common.h (_Dir_base::_At_path): New class. (_Dir_base::_Dir_Base, _Dir_base::openat): Use _At_path. * src/filesystem/dir.cc (_Dir::dir_and_pathname): Replace with current() returning _At_path. (_Dir::_Dir, _Dir::open_subdir): Adjust. 2022-08-03 Jonathan Wakely Backported from master: 2022-07-29 Jonathan Wakely PR libstdc++/104443 * include/bits/stl_iterator.h (common_iterator::operator->): Change return type to just auto. 2022-08-03 Jonathan Wakely Backported from master: 2022-07-12 Jonathan Wakely PR libstdc++/106248 * include/std/istream [C++17] (operator>>(istream&, char*)): Set eofbit if we stopped extracting at EOF. * testsuite/27_io/basic_istream/extractors_character/char/pr106248.cc: New test. * testsuite/27_io/basic_istream/extractors_character/wchar_t/pr106248.cc: New test. 2022-08-03 Jonathan Wakely Backported from master: 2022-07-01 Jonathan Wakely * include/bits/fs_ops.h: Add nodiscard to all pure functions. * include/experimental/bits/fs_ops.h: Likewise. * testsuite/27_io/filesystem/operations/all.cc: Do not discard results of absolute and canonical. * testsuite/27_io/filesystem/operations/absolute.cc: Cast discarded result to void. * testsuite/27_io/filesystem/operations/canonical.cc: Likewise. * testsuite/27_io/filesystem/operations/exists.cc: Likewise. * testsuite/27_io/filesystem/operations/is_empty.cc: Likewise. * testsuite/27_io/filesystem/operations/read_symlink.cc: Likewise. * testsuite/27_io/filesystem/operations/status.cc: Likewise. * testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise. * testsuite/27_io/filesystem/operations/temp_directory_path.cc: Likewise. * testsuite/experimental/filesystem/operations/canonical.cc: Likewise. * testsuite/experimental/filesystem/operations/exists.cc: Likewise. * testsuite/experimental/filesystem/operations/is_empty.cc: Likewise. * testsuite/experimental/filesystem/operations/read_symlink.cc: Likewise. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Likewise. 2022-08-03 Jonathan Wakely Backported from master: 2022-06-16 Jonathan Wakely PR libstdc++/105995 * include/bits/basic_string.h (_M_use_local_data): Initialize the entire SSO buffer. * testsuite/21_strings/basic_string/cons/char/105995.cc: New test. 2022-08-03 Jonathan Wakely Backported from master: 2022-06-14 Jonathan Wakely * include/bits/new_allocator.h: Fix indentation. * include/ext/malloc_allocator.h: Likewise. 2022-08-03 Jonathan Wakely Backported from master: 2022-06-14 Jonathan Wakely PR libstdc++/105957 * include/bits/allocator.h (allocator::allocate): Check for overflow in constexpr allocation. * testsuite/20_util/allocator/105975.cc: New test. 2022-08-03 Jonathan Wakely Backported from master: 2022-06-10 Jonathan Wakely PR libstdc++/105844 * include/experimental/numeric (experimental::gcd): Simplify assertions. Use __abs_r instead of __absu. (experimental::lcm): Likewise. Remove use of __detail::__lcm so overflow can be detected. * include/std/numeric (__detail::__absu): Rename to __abs_r and change to allow signed result type, so overflow can be detected. (__detail::__lcm): Remove. (gcd): Simplify assertions. Use __abs_r instead of __absu. (lcm): Likewise. Remove use of __detail::__lcm so overflow can be detected. * testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error lines. * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise. * testsuite/26_numerics/gcd/105844.cc: New test. * testsuite/26_numerics/lcm/105844.cc: New test. 2022-07-26 Thomas Rodgers Backported from master: 2022-07-26 Thomas Rodgers * include/bits/atomic_wait.h (__atomic_spin): Merge spin loops. 2022-07-22 Jonathan Wakely Backported from master: 2022-06-28 Jonathan Wakely * src/c++17/fs_dir.cc (_Dir::_Dir) [!_GLIBCXX_HAVE_OPENAT]: Always store pathname if we don't have openat or unlinkat, because the full path is needed to open sub-directories and remove entries. 2022-07-22 Alexandre Oliva Backported from master: 2022-06-27 Alexandre Oliva * src/c++17/fs_dir.cc (dir_and_pathname): Use dirfd if _GLIBCXX_HAVE_OPENAT. 2022-07-22 Alexandre Oliva Backported from master: 2022-06-24 Alexandre Oliva * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for openat. * configure, config.h.in: Rebuilt. * src/filesystem/dir-common.h (openat): Use ::openat if _GLIBCXX_HAVE_OPENAT. * src/filesystem/dir.cc (dir_and_pathname): Use dirfd if _GLIBCXX_HAVE_OPENAT. 2022-07-22 Jonathan Wakely Backported from master: 2022-05-06 Jonathan Wakely * include/std/stacktrace: Do not include . (__cxa_demangle): Declare. 2022-07-21 Jonathan Wakely Backported from master: 2022-07-20 Jonathan Wakely PR libstdc++/100823 * include/bits/stl_iterator.h (common_iterator): Define move constructor and move assignment operator. (common_iterator::_M_assign): New function implementing assignment. (common_iterator::operator=): Use _M_assign. (common_iterator::_S_valueless): New constant. * testsuite/24_iterators/common_iterator/100823.cc: New test. 2022-07-21 Jonathan Wakely Backported from master: 2022-07-20 Jonathan Wakely * include/bits/stl_iterator.h (common_iterator): Fix incorrect uses of is_nothrow_assignable_v. Fix inconsistent constraints on friend declaration. Do not move argument in copy constructor. * testsuite/24_iterators/common_iterator/1.cc: Check for noexcept constructibnle/assignable. 2022-07-21 Nathan Sidwell Backported from master: 2022-05-26 Nathan Sidwell * include/bits/hashtable.h: Include required headers. * include/bits/hashtable_policy.h: Likewise. * include/bits/stl_heap.h: Likewise. * include/bits/stl_iterator_base_funcs.h: Likewise. 2022-07-21 Jonathan Wakely Backported from master: 2022-06-30 Jonathan Wakely * include/bits/utility.h: Fix comment typos. 2022-07-21 Jonathan Wakely Backported from master: 2022-06-28 Jonathan Wakely * testsuite/20_util/from_chars/4.cc: Only use log2 if C99 math functions are available. 2022-07-21 Jonathan Wakely Backported from master: 2022-06-23 Jonathan Wakely * testsuite/26_numerics/random/random_device/entropy.cc: Use numeric_limits::digits. 2022-07-21 Marco Falke Backported from master: 2022-07-19 Marco Falke * include/std/charconv (__from_chars_alnum_to_val): Replace implicit conversion from int to unsigned char with explicit cast. 2022-07-21 Jonathan Wakely Backported from master: 2022-06-30 Jonathan Wakely PR libstdc++/88881 * src/filesystem/ops.cc (has_trailing_slash): New helper function. (fs::status): Strip trailing slashes. (fs::symlink_status): Likewise. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Clean the environment before each test and use TMP instead of TMPDIR so the test passes on Windows. 2022-07-21 Jonathan Wakely Backported from master: 2022-06-10 Jonathan Wakely PR libstdc++/105880 * libsupc++/eh_globals.cc (eh_globals): Ensure constant init and prevent destruction during termination. (__eh_globals_init::_M_init): Replace with static member _S_init. (__cxxabiv1::__cxa_get_globals_fast): Update. (__cxxabiv1::__cxa_get_globals): Likewise. 2022-07-07 Jonathan Wakely Backported from master: 2022-07-01 Jonathan Wakely PR libstdc++/106162 * include/Makefile.am (largefile-config.h): Add stamp-${host_alias} prerequisite. * include/Makefile.in: Regenerate. 2022-07-07 Jonathan Wakely Backported from master: 2022-06-23 Jonathan Wakely * testsuite/27_io/filesystem/iterators/error_reporting.cc: Use rmdir to remove directories. * testsuite/experimental/filesystem/iterators/error_reporting.cc: Likewise. 2022-06-14 Jonathan Wakely Backported from master: 2022-06-13 Jonathan Wakely * include/std/atomic (__atomic_val_t): Use __type_identity_t instead of atomic::value_type, as per LWG 3220. * testsuite/29_atomics/atomic/lwg3220.cc: New test. 2022-06-14 Mark Mentovai Backported from master: 2022-06-13 Mark Mentovai * include/experimental/bits/fs_path.h (__detail::__null_terminated): Rename to __nul_terminated to avoid colliding with a macro in Apple's SDK. 2022-06-08 Jonathan Wakely Backported from master: 2022-05-27 Jonathan Wakely PR libstdc++/105671 * include/std/sstream (basic_stringbuf::_M_high_mark): Add always_inline attribute. 2022-06-08 Jonathan Wakely Backported from master: 2022-05-26 Jonathan Wakely PR libstdc++/105681 * include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp: Limit ga_sizes array to values that fit in size_t. * include/ext/random [__SIZE_WIDTH < 32] (sfmt86243) (sfmt86243_64, sfmt132049, sfmt132049_64, sfmt216091) (sfmt216091_64): Do not declare. 2022-06-08 Jonathan Wakely Backported from master: 2022-05-19 Jonathan Wakely * include/bits/basic_string.h: Do not include here. * include/bits/cow_string.h: Include it here. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-26 Jonathan Wakely * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Make lookup for ios_errc and future_errc check versioned namespace. (StdAtomicPrinter): Strip versioned namespace from typename. 2022-05-27 François Dumont Backported from master: 2022-05-26 François Dumont * python/libstdcxx/v6/printers.py (StdSpanPrinter.__init__): Strip typename from version namespace. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-26 Jonathan Wakely * python/libstdcxx/v6/printers.py (SharedPointerPrinter): Strip versioned namespace from the template argument too. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-26 Jonathan Wakely * include/bits/stl_iterator.h (counted_iterator::operator++(int)): Add 'constexpr' as per LWG 3643. * testsuite/24_iterators/counted_iterator/lwg3643.cc: New test. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-19 Jonathan Wakely * include/std/memory_resource (polymorphic_allocator): Add non-template equality operator, as proposed for LWG 3683. * testsuite/20_util/polymorphic_allocator/lwg3683.cc: New test. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-20 Jonathan Wakely * testsuite/26_numerics/random/bernoulli_distribution/operators/values.cc: Run fewer iterations for simulator targets. * testsuite/26_numerics/random/binomial_distribution/operators/values.cc: Likewise. * testsuite/26_numerics/random/discrete_distribution/operators/values.cc: Likewise. * testsuite/26_numerics/random/geometric_distribution/operators/values.cc: Likewise. * testsuite/26_numerics/random/negative_binomial_distribution/operators/values.cc: Likewise. * testsuite/26_numerics/random/poisson_distribution/operators/values.cc: Likewise. * testsuite/26_numerics/random/uniform_int_distribution/operators/values.cc: Likewise. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-17 Jonathan Wakely * testsuite/20_util/expected/synopsis.cc: Skip for versioned namespace. * testsuite/27_io/headers/iosfwd/synopsis.cc: Likewise. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/bits/mofunc_impl.h: Fix doxygen command. 2022-05-27 Jonathan Wakely Backported from master: 2022-05-13 Jonathan Wakely * include/std/future (launch): Make operators noexcept. 2022-05-16 Jonathan Wakely Backported from master: 2022-05-16 Jonathan Wakely * doc/xml/manual/prerequisites.xml: Fix attributes for external hyperlink. * doc/html/manual/setup.html: Regenerate. 2022-05-16 Jonathan Wakely Backported from master: 2022-05-16 Jonathan Wakely * doc/xml/manual/status_cxx2023.xml: Update with gcc-12 support. * doc/html/*: Regenerate. 2022-05-16 Jonathan Wakely Backported from master: 2022-05-16 Jonathan Wakely * doc/xml/manual/intro.xml: Include new chapter. * doc/xml/manual/status_cxx2020.xml: Tweak release numbers. * doc/xml/manual/status_cxx2023.xml: New file. * doc/html/*: Regenerate. 2022-05-16 Jonathan Wakely Backported from master: 2022-05-16 Jonathan Wakely * doc/html/manual/status.html: Regenerate. * doc/xml/manual/status_cxx2020.xml: Fix supported version for C++20 bit operations. 2022-05-13 Alexandre Oliva Backported from master: 2022-05-06 Alexandre Oliva * include/experimental/bits/simd.h [__ALTIVEC__]: Require VSX for double, long long, and 64-bit long intrinsic types. [__ALTIVEC__] (__intrinsic_type): Mention 128-bit in preexisting long double diagnostic, adjust no-VSX double diagnostic to cover 64-bit long double as well. 2022-05-10 Jonathan Wakely Backported from master: 2022-05-10 Jonathan Wakely PR libstdc++/105284 * include/std/iosfwd: Add declarations for class templates and typedefs. * include/std/spanstream (basic_spanbuf, basic_ispanstream) (basic_ospanstream, basic_spanstream): Remove default template arguments. * testsuite/27_io/headers/iosfwd/synopsis.cc: Add declarations. * testsuite/27_io/headers/iosfwd/types.cc: Check default arguments. 2022-05-10 Jonathan Wakely Backported from master: 2022-05-10 Jonathan Wakely PR libstdc++/105284 * include/std/iosfwd: Add declarations for class templates and typedefs. * include/std/syncstream (basic_syncbuf, basic_osyncstream): Remove default template arguments. * testsuite/27_io/headers/iosfwd/synopsis.cc: New test. * testsuite/27_io/headers/iosfwd/types.cc: New test. 2022-05-09 Jonathan Wakely Backported from master: 2022-05-06 Jonathan Wakely PR libstdc++/104731 * testsuite/27_io/filesystem/iterators/error_reporting.cc: Use a trailing char array as storage for dirent::d_name. 2022-05-06 Jonathan Wakely Backported from master: 2022-05-06 Jonathan Wakely PR libstdc++/105502 * include/bits/random.tcc (operator>>(basic_istream&, normal_distribution&)): Update state when __state_avail is false. * testsuite/26_numerics/random/normal_distribution/operators/serialize.cc: Check that deserialized object equals serialized one. 2022-05-06 Patrick Palka Backported from master: 2022-05-02 Patrick Palka PR libstdc++/103911 * src/c++17/floating_from_chars.cc (find_end_of_float): Accept two delimeters for the exponent part in the form of a possibly NULL string of length two. Don't use std::tolower. (pattern): Adjust calls to find_end_of_float accordingly. 2022-05-06 Alexandre Oliva Backported from master: 2022-05-03 Alexandre Oliva PR c++/105324 * testsuite/20_util/from_chars/pr105324.cc: Guard test body with conditional for floating-point overloads of from_char. 2022-05-06 Release Manager * GCC 12.1.0 released. 2022-05-02 Patrick Palka Backported from master: 2022-05-02 Patrick Palka PR libstdc++/105441 * src/c++17/floating_from_chars.cc (__floating_from_chars_hex): Also accept 'P' as the start of the exponent. * testsuite/20_util/from_chars/7.cc: Add corresponding testcase. 2022-04-29 Jonathan Wakely Backported from master: 2022-04-29 Jonathan Wakely PR libstdc++/105417 * config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Regenerate. * src/c++11/compatibility-ldbl-alt128.cc [_GLIBCXX_USE_DUAL_ABI]: Define __gnu_ieee128::num_get::_M_extract_int[abi:cxx11] symbols as aliases for corresponding symbols without abi-tag. 2022-04-29 Rainer Orth * config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate. * config/abi/post/i386-solaris/amd64/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt: Likewise. 2022-04-28 Jonathan Wakely * doc/xml/manual/status_cxx1998.xml: Refer to GCC 12 not mainline. * doc/xml/manual/status_cxx2011.xml: Likewise. * doc/xml/manual/status_cxx2014.xml: Likewise. * doc/xml/manual/status_cxx2017.xml: Likewise. * doc/xml/manual/status_cxx2020.xml: Likewise. * doc/xml/manual/status_cxxtr1.xml: Likewise. * doc/xml/manual/status_cxxtr24733.xml: Likewise. * doc/html/manual/status.html: Regenerate. 2022-04-28 Jonathan Wakely PR libstdc++/99290 * src/c++17/fs_ops.cc (fs::copy): Pass error_code to directory_iterator constructor, and check on each iteration. * src/filesystem/ops.cc (fs::copy): Likewise. * testsuite/27_io/filesystem/operations/copy.cc: Check for errors during recursion. * testsuite/experimental/filesystem/operations/copy.cc: Likewise. 2022-04-28 François Dumont * config/abi/pre/gnu-versioned-namespace.ver: Remove std::random_device::* pattern. 2022-04-27 Jakub Jelinek * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update. * config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update. 2022-04-27 Jonathan Wakely * python/libstdcxx/v6/printers.py (SharedPointerPrinter): Add support for atomic> and atomic>. (StdAtomicPrinter): New printer. (build_libstdcxx_dictionary): Register new printer. * testsuite/libstdc++-prettyprinters/cxx11.cc: Test std::atomic. * testsuite/libstdc++-prettyprinters/cxx20.cc: Test atomic smart pointers. 2022-04-26 Jonathan Wakely * include/bits/shared_ptr_atomic.h (atomic): Add constructor for constant initialization from nullptr_t. * testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: Check for new constructor. 2022-04-26 Jonathan Wakely * include/bits/fs_path.h (hash): Define. * testsuite/27_io/filesystem/path/nonmember/hash_value.cc: Check std::hash specialization. 2022-04-25 Jonathan Wakely * include/bits/ptr_traits.h (__cpp_lib_constexpr_memory): Define conditionally. * include/bits/unique_ptr.h (__cpp_lib_constexpr_memory): Define for C++23. (default_delete, default_delete, __uniq_ptr_impl) (unique_ptr, unique_ptr): Add constexpr to all member functions. * include/std/version (__cpp_lib_constexpr_memory): Define new value for C++23. * testsuite/20_util/unique_ptr/assign/constexpr.cc: New test. * testsuite/20_util/unique_ptr/comparison/constexpr.cc: New test. * testsuite/20_util/unique_ptr/cons/constexpr_c++20.cc: New test. * testsuite/20_util/unique_ptr/creation/constexpr.cc: New test. * testsuite/20_util/unique_ptr/modifiers/constexpr.cc: New test. * testsuite/20_util/unique_ptr/specialized_algorithms/constexpr.cc: New test. 2022-04-25 Jonathan Wakely PR libstdc++/105375 * include/std/future (packaged_task): Add deduction guides. * testsuite/30_threads/packaged_task/cons/deduction.cc: New test. 2022-04-25 Philipp Fent * python/libstdcxx/v6/printers.py (StdSpanPrinter._iterator): Rename as iterator. (StdInitializerListPrinter): Define new printer. (build_libstdcxx_dictionary): Register new printer. * testsuite/libstdc++-prettyprinters/cxx11.cc: Check printer for initializer_list. 2022-04-22 Thomas W Rodgers PR libstdc++/102994 * include/bits/atomic_base.h (atomic_flag::notify_one, notify_all): Remove const qualification. (__atomic_base::notify_one, notify_all): Likewise. * include/std/atomic (atomic::notify_one, notify_all): Likewise. (atomic::notify_one, notify_all): Likewise. (atomic::notify_one, notify_all): Likewise. (atomic_notify_one, atomic_notify_all): Likewise. * testsuite/29_atomics/atomic/wait_notify/102994.cc: Adjust test to account for change in notify_one/notify_all signature. 2022-04-21 Patrick Palka * include/std/charconv (__from_chars_alnum_to_val_table): Simplify initialization of __lower/__upper_letters. (__from_chars_alnum_to_val): Default the template parameter to false. * src/c++17/floating_from_chars.cc (starts_with_ci): Don't assume the uppercase and lowercase letters are contiguous. (__floating_from_chars_hex): Likewise. 2022-04-21 Patrick Palka PR c++/105297 PR c++/105322 * include/std/charconv (__from_chars_alnum_to_val): Make initializer for __table dependent in an artificial way. 2022-04-21 Jonathan Wakely PR libstdc++/105324 * src/c++17/floating_from_chars.cc (buffer_resource::do_allocate): Remove assertion. * testsuite/20_util/from_chars/pr105324.cc: New test. 2022-04-20 Jonathan Wakely * testsuite/21_strings/basic_string_view/operations/copy/char/constexpr.cc: Check correct feature test macro. 2022-04-20 Jonathan Wakely PR libstdc++/93602 * doc/xml/manual/prerequisites.xml: Document libiconv workarounds. * doc/html/manual/setup.html: Regenerate. * src/Makefile.am (CXXLINK): Add $(LTLIBICONV). * src/Makefile.in: Regenerate. 2022-04-19 Patrick Palka * src/c++17/floating_to_chars.cc (_GLIBCXX_ASSERTIONS): Don't define. (__floating_to_chars_shortest): Add __builtin_unreachable calls to squelch false-positive -Wmaybe-uninitialized and -Wreturn-type warnings. (__floating_to_chars_precision): Likewise. 2022-04-19 Philipp Fent * python/libstdcxx/v6/printers.py (StdSpanPrinter): Define. * testsuite/libstdc++-prettyprinters/cxx20.cc: Test it. 2022-04-19 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Fix shell operators. * configure: Regenerate. 2022-04-18 Patrick Palka * include/std/charconv (__from_chars_pow2_base): Manually unroll the first iteration of the main loop and simplify accordingly. 2022-04-15 Patrick Palka PR libstdc++/104858 * include/bits/ranges_algo.h (__minmax_fn): Avoid dereferencing __first twice at the start. * testsuite/25_algorithms/minmax/constrained.cc (test06): New test. 2022-04-15 Patrick Palka * include/std/charconv (__from_chars_alnum_to_val_table): Define. (__from_chars_alnum_to_val): Define. (__from_chars_binary): Rename to ... (__from_chars_pow2_base): ... this. Generalize to handle any power-of-two base using __from_chars_alnum_to_val. (__from_chars_digit): Optimize digit recognition to a single test instead of two tests. Use [[__unlikely___]] attribute. (__from_chars_alpha_to_num): Remove. (__from_chars_alnum): Use __from_chars_alnum_to_val. Use a nested loop for the overflow case. Maintain a lower bound on the number of available bits in the result and use it to omit the overflow check. (from_chars): Adjust appropriately. * src/c++17/floating_from_chars.cc (ascii_to_hexit): Remove. (__floating_from_chars_hex): Use __from_chars_alnum_to_val to recognize a hex digit instead. 2022-04-14 Palmer Dabbelt * acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Force auto to mutex for RISC-V. * configure: Regenerate. 2022-04-14 Jonathan Wakely * doc/xml/manual/intro.xml: Fix comment. 2022-04-14 Jonathan Wakely * include/precompiled/stdc++.h: Include and for C++23. 2022-04-14 Jonathan Wakely PR libstdc++/105269 * include/bits/stl_vector.h (__cpp_lib_constexpr_vector): Define. * include/c_compatibility/stdatomic.h (__cpp_lib_stdatomic_h): Define. * include/std/optional (__cpp_lib_optional): Define new value for C++23. (__cpp_lib_monadic_optional): Remove. * include/std/version (__cpp_lib_constexpr_vector): Define. (__cpp_lib_stdatomic_h): Define. (__cpp_lib_optional): Define new value for C++23. (__cpp_lib_monadic_optional): Remove. * testsuite/20_util/optional/monadic/and_then.cc: Adjust. * testsuite/20_util/optional/requirements.cc: Adjust for C++23. * testsuite/20_util/optional/version.cc: Likewise. * testsuite/23_containers/vector/cons/constexpr.cc: Check feature test macro. * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Likewise. * testsuite/20_util/optional/monadic/version.cc: Removed. * testsuite/23_containers/vector/requirements/version.cc: New test. * testsuite/29_atomics/headers/stdatomic.h/version.cc: New test. 2022-04-12 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Check for mmap. * config.h.in: Regenerate. * configure: Regenerate. 2022-04-12 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::current): Reallocate a smaller container if the unused capacity is larger than the used size. 2022-04-12 Jonathan Wakely * include/std/stacktrace (basic_stacktrace): Use _Impl::_M_clone or _Impl::_M_assign to initialize elements in allocated storage. (basic_stacktrace::_M_clear()): Use _Impl::_M_resize instead of _Impl::_M_destroy. (basic_stacktrace::_Impl::_M_destroy()): Replace with ... (basic_stacktrace::_Impl::_M_resize(size_type, allocator&)): New function. (basic_stacktrace::_Impl::_M_push_back): Use _M_xclone. Construct new element using allocator. (basic_stacktrace::_Impl::_M_clone): New function. (basic_stacktrace::_Impl::_M_xclone): New function. (basic_stacktrace::_Impl::_M_assign): New function. 2022-04-12 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::_Impl::_M_allocate): Use nothrow new instead of try block for std::allocator. (basic_stacktrace::_Impl::_M_deallocate): Use delete for std::allocator. 2022-04-12 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::current): Replace calls to _M_reserve and _S_curr_cb with call to _M_prepare. Check return value of backtrace_simple when max depth given. (basic_stacktrace::_M_reserve): Remove. (basic_stacktrace::_S_curr_cb): Remove. (basic_stacktrace::_M_prepare(size_type)): New function to reserve initial capacity and return callback. (basic_stacktrace::_Impl::_M_allocate): Remove check for 0 < n and remove redundant zeroing of _M_frames and _M_capacity. (basic_stacktrace::_Impl::_M_push_back): Add [[unlikely]] attribute. Assign _Impl instead of swapping. * testsuite/19_diagnostics/stacktrace/current.cc: New test. 2022-04-11 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::_Impl::_M_allocate): Change [[unlikely]] attribute to [[likely]]. 2022-04-11 Jonathan Wakely PR libstdc++/105031 * include/std/stacktrace (basic_stacktrace::basic_stacktrace): Fix allocator usage in constructors. (basic_stacktrace::operator=(const basic_stacktrace&)): Do not try to reallocate using const allocator. (basic_stacktrace::operator=(basic_stacktrace&&)): Fix if-constexpr with non-constant condition. Do not allocate new storage if allocator propagates. Do not set _M_size if allocation fails. (basic_stacktrace::swap(basic_stacktrace&)): Fix typo. Add assertion that non-propagating allocators are equal. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: New test. 2022-04-11 Jonathan Wakely * include/std/stacktrace (basic_stacktrace::current): Duplicate implementation into each overload. Add noinline attribute and skip current frame. (basic_stacktrace::max_size()): Call _Impl::_S_max_size. (basic_stacktrace::_S_curr_cb()): New function defining lambda. (basic_stacktrace::_Impl::_S_max_size): New function defining maximum size in terms of allocator and size_type. (basic_stacktrace::_Impl::_M_allocate): Check against max_size(). * testsuite/19_diagnostics/stacktrace/entry.cc: Call function for non-constexpr checks. Check line number is correct. 2022-04-11 Jonathan Wakely * testsuite/20_util/stacktrace/entry.cc: Moved to... * testsuite/19_diagnostics/stacktrace/entry.cc: ...here. * testsuite/20_util/stacktrace/synopsis.cc: Moved to... * testsuite/19_diagnostics/stacktrace/synopsis.cc: ...here. * testsuite/20_util/stacktrace/version.cc: Moved to... * testsuite/19_diagnostics/stacktrace/version.cc: ...here. 2022-04-11 Jonathan Wakely * include/experimental/bits/fs_path.h (path): Define special members after path::_Cmpt is complete. 2022-04-08 Jonathan Wakely PR libstdc++/105153 * include/std/expected (expected::expected(expected&&)): Fix constraints. * testsuite/20_util/expected/cons.cc: Check constructor. 2022-04-08 Jonathan Wakely PR libstdc++/105154 * include/std/expected (expected::swap): Set _M_has_value to false for objects that previously had a value. * testsuite/20_util/expected/swap.cc: Fix test to check void specialization. 2022-04-08 Jonathan Wakely PR libstdc++/105146 * include/std/expected (bad_expected_access): Move constructor parameter. * testsuite/20_util/expected/bad.cc: New test. 2022-04-07 Hans-Peter Nilsson * testsuite/20_util/expected/requirements.cc: Correct minimal-size test. 2022-04-02 Jakub Jelinek PR libstdc++/105128 * include/std/source_location (std::source_location::__impl): Move definition before using __builtin_ret_type. 2022-04-01 Jonathan Wakely * include/std/utility (unreachable): Define for C++23. * include/std/version (__cpp_lib_unreachable): Define. * src/c++11/debug.cc (__glibcxx_assert_fail): Check for valid arguments. Handle only the function being given. * testsuite/20_util/unreachable/1.cc: New test. * testsuite/20_util/unreachable/version.cc: New test. 2022-04-01 Jonathan Wakely * include/experimental/bits/fs_fwd.h (copy_file): Remove incorrect noexcept from declaration. * include/experimental/bits/fs_path.h (path::begin, path::end): Add noexcept to declarations, to match definitions. 2022-04-01 Timm Bäder * include/bits/fs_ops.h: Fix filename in Doxygen comment. * include/experimental/bits/fs_ops.h: Likewise. 2022-03-31 Jonathan Wakely * libsupc++/new_opa.cc (aligned_alloc): Add comment. 2022-03-29 Jonathan Wakely * testsuite/18_support/exception/38732.cc: Disable for C++23. * testsuite/18_support/headers/exception/synopsis.cc: Likewise. * testsuite/18_support/unexpected_handler.cc: Likewise. 2022-03-29 Jonathan Wakely * libsupc++/compare (_Strong_order) [!__cpp_using_enum]: Add static data members for _Fp_fmt enumerators. 2022-03-29 Jonathan Wakely * include/std/version (__cpp_lib_variant): Fix conditions to match . (__cpp_lib_expected): Fix condition to match . 2022-03-28 Jonathan Wakely * testsuite/20_util/optional/monadic/and_then.cc: Fix typo. * testsuite/20_util/optional/monadic/transform.cc: Likewise. * testsuite/22_locale/codecvt/always_noconv/char/1.cc: Likewise. * testsuite/22_locale/codecvt/encoding/char/1.cc: Likewise. * testsuite/22_locale/codecvt/in/char/1.cc: Likewise. * testsuite/22_locale/codecvt/max_length/char/1.cc: Likewise. * testsuite/22_locale/codecvt/out/char/1.cc: Likewise. * testsuite/22_locale/codecvt/unshift/char/1.cc: Likewise. 2022-03-27 Jonathan Wakely * doc/doxygen/user.cfg.in: Add new header. * include/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Add new header. * include/std/version (__cpp_lib_expected): Define. * libsupc++/exception [__cplusplus > 202002] (unexpected) (unexpected_handler, set_unexpected): Do not declare for C++23. * include/std/expected: New file. * testsuite/20_util/expected/assign.cc: New test. * testsuite/20_util/expected/cons.cc: New test. * testsuite/20_util/expected/illformed_neg.cc: New test. * testsuite/20_util/expected/observers.cc: New test. * testsuite/20_util/expected/requirements.cc: New test. * testsuite/20_util/expected/swap.cc: New test. * testsuite/20_util/expected/synopsis.cc: New test. * testsuite/20_util/expected/unexpected.cc: New test. * testsuite/20_util/expected/version.cc: New test. 2022-03-25 Jonathan Wakely * include/std/bit (bit_cast, byteswap, endian): Add doxygen comments. 2022-03-23 Jonathan Wakely PR libstdc++/105027 * include/std/bit (bit_cast): Add constraints. * testsuite/26_numerics/bit/bit.cast/105027.cc: New test. 2022-03-23 Jonathan Wakely * include/std/version [!_GLIBCXX_HOSTED] (__cpp_lib_hardware_interference_size): Define for freestanding. (__cpp_lib_bit_cast): Likewise. (__cpp_lib_is_layout_compatible): Likewise. (__cpp_lib_is_pointer_interconvertible): Likewise. (__cpp_lib_adaptor_iterator_pair_constructor): Do not define for freestanding. (__cpp_lib_invoke_r): Likewise. (__cpp_lib_ios_noreplace): Likewise. (__cpp_lib_monadic_optional): Likewise. (__cpp_lib_move_only_function): Likewise. (__cpp_lib_spanstream): Likewise. (__cpp_lib_stacktrace): Likewise. (__cpp_lib_string_contains): Likewise. (__cpp_lib_string_resize_and_overwrite): Likewise. (__cpp_lib_to_underlying): Likewise. 2022-03-23 Jonathan Wakely PR libstdc++/105021 * include/bits/atomic_base.h [!_GLIBCXX_HOSTED]: Do not include for freestanding. 2022-03-22 Hans-Peter Nilsson * testsuite/20_util/from_chars/6.cc (test01) [FE_DOWNWARD]: Conditionalize call to fesetround. 2022-03-21 Jakub Jelinek PR libstdc++/104990 * include/bits/locale_facets_nonio.tcc (get): Don't check if do_get isn't overloaded if __clang__ is defined. 2022-03-18 Jonathan Wakely PR libstdc++/104242 * include/std/any (any(T&&)): Revert change to constraints. * testsuite/20_util/any/cons/104242.cc: New test. 2022-03-18 Jonathan Wakely PR libstdc++/92546 * include/pstl/glue_algorithm_defs.h: Replace with . * include/pstl/utils.h: Replace with . (__pstl::__internal::__except_handler): Use std::__terminate instead of std::terminate. * src/c++17/fs_path.cc: Include . * testsuite/25_algorithms/adjacent_find/constexpr.cc: Include . * testsuite/25_algorithms/binary_search/constexpr.cc: Likewise. * testsuite/25_algorithms/clamp/constrained.cc: Likewise. * testsuite/25_algorithms/equal/constrained.cc: Likewise. * testsuite/25_algorithms/for_each/constrained.cc: Likewise. * testsuite/25_algorithms/includes/constrained.cc: Likewise. * testsuite/25_algorithms/is_heap/constexpr.cc: Likewise. * testsuite/25_algorithms/is_heap_until/constexpr.cc: Likewise. * testsuite/25_algorithms/is_permutation/constrained.cc: Include . * testsuite/25_algorithms/is_sorted/constexpr.cc: Include . * testsuite/25_algorithms/is_sorted_until/constexpr.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare/constexpr.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare/constrained.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare_three_way/1.cc: Include . * testsuite/25_algorithms/lower_bound/constexpr.cc: Include . * testsuite/25_algorithms/max/constrained.cc: Likewise. * testsuite/25_algorithms/max_element/constrained.cc: Likewise. * testsuite/25_algorithms/min/constrained.cc: Likewise. * testsuite/25_algorithms/min_element/constrained.cc: Likewise. * testsuite/25_algorithms/minmax_element/constrained.cc: Likewise. * testsuite/25_algorithms/mismatch/constexpr.cc: Likewise. * testsuite/25_algorithms/move/93872.cc: Likewise. * testsuite/25_algorithms/move_backward/93872.cc: Include . * testsuite/25_algorithms/nth_element/constexpr.cc: Include . * testsuite/25_algorithms/partial_sort/constexpr.cc: Likewise. * testsuite/25_algorithms/partial_sort_copy/constexpr.cc: Likewise. * testsuite/25_algorithms/search/constexpr.cc: Likewise. * testsuite/25_algorithms/search_n/constrained.cc: Likewise. * testsuite/25_algorithms/set_difference/constexpr.cc: Likewise. * testsuite/25_algorithms/set_difference/constrained.cc: Likewise. * testsuite/25_algorithms/set_intersection/constexpr.cc: Likewise. * testsuite/25_algorithms/set_intersection/constrained.cc: Likewise. * testsuite/25_algorithms/set_symmetric_difference/constexpr.cc: Likewise. * testsuite/25_algorithms/set_union/constexpr.cc: Likewise. * testsuite/25_algorithms/set_union/constrained.cc: Likewise. * testsuite/25_algorithms/sort/constexpr.cc: Likewise. * testsuite/25_algorithms/sort_heap/constexpr.cc: Likewise. * testsuite/25_algorithms/transform/constrained.cc: Likewise. * testsuite/25_algorithms/unique/constexpr.cc: Likewise. * testsuite/25_algorithms/unique/constrained.cc: Likewise. * testsuite/25_algorithms/unique_copy/constexpr.cc: Likewise. * testsuite/25_algorithms/upper_bound/constexpr.cc: Likewise. * testsuite/std/ranges/adaptors/elements.cc: Include . * testsuite/std/ranges/adaptors/lazy_split.cc: Likewise. * testsuite/std/ranges/adaptors/split.cc: Likewise. 2022-03-17 Jonathan Wakely PR libstdc++/92546 * include/bits/fs_path.h (path::make_preferred): Use handwritten loop instead of std::replace. 2022-03-17 Jonathan Wakely PR middle-end/104966 * include/bits/locale_facets_nonio.tcc (__moneypunct_cache::_M_cache): Replace try-catch with RAII and make all string copies before any stores to *this. 2022-03-17 Jonathan Wakely * testsuite/util/testsuite_character.h: Fix comment. 2022-03-16 Jonathan Wakely PR libstdc++/103407 * config/abi/pre/gnu.ver: Make version for std::from_chars depend on HAVE_USELOCALE macro. * testsuite/util/testsuite_abi.cc (compare_symbols): Treat std::from_chars for floating-point types as undesignated if not found in the baseline symbols file. 2022-03-16 Jonathan Wakely * include/std/charconv (__cpp_lib_to_chars): Only define when both from_chars and to_chars are supported for floating-point types. (from_chars, to_chars): Adjust preprocessor conditions guarding declarations. * include/std/version (__cpp_lib_to_chars): Adjust condition to match definition. * src/c++17/floating_from_chars.cc (from_chars_strtod): New function template. (from_chars): Simplify preprocessor checks and use from_chars_strtod when appropriate. 2022-03-14 Jonathan Wakely PR libstdc++/104875 * src/c++11/codecvt.cc (read_utf8_code_point): Use char32_t to hold octets that will be left-shifted. 2022-03-10 Jonathan Wakely PR libstdc++/104870 * src/c++17/floating_from_chars.cc: Check __SIZE_WIDTH__ >= 32 before using fast_float. 2022-03-10 Detlef Vollmann PR libstdc++/104866 * include/bits/this_thread_sleep.h: Fix order of #endif and closing brace of namespace. 2022-03-10 Jonathan Wakely * libsupc++/compare (_Strong_order::_S_fp_cmp) [__vax__]: Handle NaN. 2022-03-10 Jonathan Wakely * libsupc++/compare (_Strong_ordering::_S_fp_cmp) [__vax__]: Use <=> comparison. 2022-03-09 Patrick Palka PR libstdc++/104859 * src/c++17/floating_to_chars.cc (__floating_to_chars_hex): Be explicit when narrowing the shifted effective_mantissa, since it may have an integer-class type. 2022-03-08 Jonathan Wakely * include/bits/uses_allocator_args.h: Remove incorrect copyright notice. 2022-03-07 Jonathan Wakely PR libstdc++/104807 * include/bits/c++config (__terminate, __glibcxx_assert_fail): Replace _GLIBCXX_VISIBILITY on function with visibility pragma. (__is_constant_evaluated): Add visibility pragma. 2022-03-07 Rasmus Villemoes * config/locale/vxworks/ctype_members.cc: Remove include. 2022-03-05 Jonathan Wakely * include/bits/c++config (__glibcxx_assert_fail): Add visibility attribute. (__terminate): Likewise. 2022-03-04 Jonathan Wakely * libsupc++/compare (strong_order::_S_fp_cmp): Move typedef inside #if condition. 2022-03-03 Jonathan Wakely PR libstdc++/104748 * testsuite/std/ranges/adaptors/all.cc: Use non-debug vector for constexpr test. 2022-03-03 Jonathan Wakely * testsuite/17_intro/names.cc (func): Undef on AIX. 2022-03-03 Jonathan Wakely PR libstdc++/96526 * libsupc++/compare (strong_order): Add missing support for floating-point types. * testsuite/18_support/comparisons/algorithms/strong_order_floats.cc: New test. 2022-03-01 Jonathan Wakely PR middle-end/103984 * include/bits/regex_compiler.h (_BracketMatcher::_M_char): Use default member initializer. 2022-02-24 Jonathan Wakely PR libstdc++/104602 * include/std/source_location (source_location::current): Use deduced type of __builtin_source_location(). 2022-02-22 Patrick Palka * include/bits/ranges_base.h (__detail::__is_initializer_list): Define. (viewable_range): Adjust as per P2415R2. * include/bits/ranges_cmp.h (__cpp_lib_ranges): Adjust value. * include/std/ranges (owning_view): Define as per P2415R2. (enable_borrowed_range): Likewise. (views::__detail::__can_subrange): Replace with ... (views::__detail::__can_owning_view): ... this. (views::_All::_S_noexcept): Sync with operator(). (views::_All::operator()): Use owning_view instead of subrange as per P2415R2. * include/std/version (__cpp_lib_ranges): Adjust value. * testsuite/std/ranges/adaptors/all.cc (test06): Adjust now that views::all uses owning_view instead of subrange. (test08): New test. * testsuite/std/ranges/adaptors/lazy_split.cc (test09): Adjust now that rvalue non-view non-borrowed ranges are viewable. * testsuite/std/ranges/adaptors/split.cc (test06): Likewise. 2022-02-17 Jonathan Wakely PR libstdc++/104559 * doc/xml/manual/evolution.xml: Document deprecation. * doc/html/manual/api.html: Regenerate. * include/bits/stl_bvector.h (insert(const_iterator, const bool&)): Remove default argument. (insert(const_iterator)): New overload with deprecated attribute. * testsuite/23_containers/vector/bool/modifiers/insert/104559.cc: New test. 2022-02-17 Jonathan Wakely * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Replace code that call cat->name() on std::error_category objects. Identify known categories by symbol name and use a hardcoded name. Print error code values as enumerators where appopriate. * testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected name of custom category. Check io_errc and future_errc errors. 2022-02-15 Jonathan Wakely PR libstdc++/104542 * include/bits/uses_allocator_args.h (make_obj_using_allocator) (uninitialized_construct_using_allocator): Add constexpr. * testsuite/20_util/uses_allocator/make_obj.cc: Check constexpr. * testsuite/20_util/uses_allocator/uninitialized_construct.cc: New test. 2022-02-14 Jonathan Wakely PR libstdc++/100912 * config/locale/gnu/c_locale.h (__convert_from_v): Use inline namespace for IEEE128 long double mode. * config/os/gnu-linux/ldbl-ieee128-extra.ver: Add new symbol version and export __gnu_cxx_ieee128::__convert_from_v. * include/bits/locale_facets_nonio.tcc (money_put::__do_put): Make __ibm128 overload use snprintf directly * testsuite/util/testsuite_abi.cc: Add new symbol version. Remove stable IEEE128/LDBL versions. 2022-02-14 Jonathan Wakely PR libstdc++/103891 * include/bits/c++config (_GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS): Remove. * include/std/variant: Check feature test macros instead. * include/std/version: Likewise. 2022-02-14 Jonathan Wakely * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Fix typo. 2022-02-14 Jonathan Wakely * src/c++17/floating_to_chars.cc (FLOAT128_TO_CHARS): Depend on LONG_DOUBLE_ALT128_COMPAT instead of USE_FLOAT128. 2022-02-11 Jonathan Wakely * testsuite/20_util/temporary_buffer.cc: Fix dg-warning target selector. 2022-02-11 Jonathan Wakely * testsuite/20_util/monotonic_buffer_resource/allocate.cc: Ignore -Walloc-larger-than warning. * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Likewise. * testsuite/29_atomics/atomic/cons/user_pod.cc: Compile with -O1 to avoid linker error for __atomic_is_lock_free. 2022-02-10 Thomas Rodgers * include/bits/atomic_wait.h (__waiter_base::_S_do_spin, __waiter_base::_S_do_spin_v): Change memory order from relaxed to acquire. 2022-02-10 Jonathan Wakely * include/c_compatibility/stdatomic.h (atomic_fetch_xor): Add using-declaration. (atomic_fetch_xor_explicit): Likewise. * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Check arithmetic and logical operations for atomic_int. 2022-02-10 Jonathan Wakely * src/filesystem/dir-common.h (_GLIBCXX_HAVE_DIRFD): Undefine when is not available. (_GLIBCXX_HAVE_UNLINKAT): Likewise. 2022-02-09 Thomas Rodgers PR libstdc++/104442 * include/bits/atomic_wait.h (__waiter::_M_do_wait_v): Move spin loop inside do loop so that threads failing the wait, reload _M_ver. 2022-02-08 Jonathan Wakely * src/c++17/fs_dir.cc (_Dir(DIR*, const path&)): Change first parameter to _Dir_base&&. * src/filesystem/dir-common.h (_Dir_base(DIR*)): Remove. * src/filesystem/dir.cc (_Dir(DIR*, const path&)): Change first parameter to _Dir_base&&. 2022-02-08 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Add comment about checking for CAS on correct word size. 2022-02-08 Jonathan Wakely * testsuite/experimental/filesystem/operations/create_directories.cc: Adjust expected results for Windows. 2022-02-08 Jonathan Wakely PR libstdc++/104161 * src/c++17/fs_dir.cc (fs::recursive_directory_iterator::__erase): [i_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Refresh entry._M_type member, instead of checking for errno values indicating a directory. * src/c++17/fs_ops.cc (fs::remove_all(const path&)): Use similar logic to non-throwing overload. (fs::remove_all(const path&, error_code&)): Add comments. * src/filesystem/ops-common.h: Likewise. 2022-02-04 Jonathan Wakely * src/filesystem/dir-common.h (_Dir_base::openat): Change return type to use portable posix::DIR alias. 2022-02-04 Jonathan Wakely * include/c_compatibility/stdatomic.h [__clang__]: Use #include_next . 2022-02-04 Jonathan Wakely * include/experimental/bits/fs_ops.h (fs::copy_file): Remove noexcept. (fs::create_directories): Likewise. (fs::remove_all): Likewise. * src/filesystem/ops.cc (fs::copy_file): Remove noexcept. (fs::create_directories): Likewise. (fs::remove_all): Likewise. 2022-02-04 Jonathan Wakely PR libstdc++/104161 * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for dirfd and unlinkat. * config.h.in: Regenerate. * configure: Regenerate. * include/bits/fs_dir.h (recursive_directory_iterator): Declare remove_all overloads as friends. (recursive_directory_iterator::__erase): Declare new member function. * include/bits/fs_fwd.h (remove, remove_all): Declare. * src/c++17/fs_dir.cc (_Dir): Add filename_only parameter to constructor. Pass file descriptor argument to base constructor. (_Dir::dir_and_pathname, _Dir::open_subdir, _Dir::do_unlink) (_Dir::unlink, _Dir::rmdir): Define new member functions. (directory_iterator): Pass filename_only argument to _Dir constructor. (recursive_directory_iterator::_Dir_stack): Adjust constructor parameters to take a _Dir rvalue instead of creating one. (_Dir_stack::orig): Add data member for storing original path. (_Dir_stack::report_error): Define new member function. (__directory_iterator_nofollow): Move here from dir-common.h and fix value to be a power of two. (__directory_iterator_filename_only): Define new constant. (recursive_directory_iterator): Construct _Dir object and move into _M_dirs stack. Pass skip_permission_denied argument to first advance call. (recursive_directory_iterator::increment): Use _Dir::open_subdir. (recursive_directory_iterator::__erase): Define new member function. * src/c++17/fs_ops.cc (ErrorReporter, do_remove_all): Remove. (fs::remove_all): Use new recursive_directory_iterator::__erase member function. * src/filesystem/dir-common.h (_Dir_base): Add int parameter to constructor and use openat to implement nofollow semantics. (_Dir_base::fdcwd, _Dir_base::set_close_on_exec, _Dir_base::openat): Define new member functions. (__directory_iterator_nofollow): Move to fs_dir.cc. * src/filesystem/dir.cc (_Dir): Pass file descriptor argument to base constructor. (_Dir::dir_and_pathname, _Dir::open_subdir): Define new member functions. (recursive_directory_iterator::_Dir_stack): Adjust constructor parameters to take a _Dir rvalue instead of creating one. (recursive_directory_iterator): Check for new nofollow option. Construct _Dir object and move into _M_dirs stack. Pass skip_permission_denied argument to first advance call. (recursive_directory_iterator::increment): Use _Dir::open_subdir. * src/filesystem/ops.cc (fs::remove_all): Use C++17 remove_all. 2022-02-04 Jonathan Wakely * include/bits/allocator.h: Qualify std::allocator_traits in deprecated warnings. * libsupc++/exception (uncaught_exception): Add suggestion to deprecated warning. 2022-02-02 Jonathan Wakely * src/c++17/fs_dir.cc (fs::recursive_directory_iterator::pop): Add [[maybe_unused]] attribute. * src/filesystem/dir.cc (fs::recursive_directory_iterator::pop): Likewise. 2022-02-02 Jonathan Wakely * testsuite/23_containers/multiset/operators/cmp_c++20.cc: Use custom comparison function for multiset. * testsuite/23_containers/set/operators/cmp_c++20.cc: Use custom comparison function for set. 2022-02-02 Jonathan Wakely * include/bits/boost_concept_check.h (_OutputIteratorConcept): Change member function to data member of function pointer type. 2022-02-02 Martin Sebor PR libstdc++/101831 * include/std/array (begin): Declare const member function attribute const. (end, rbegin, rend, size, max_size, empty, data): Same. * testsuite/23_containers/array/capacity/empty.cc: Add test cases. * testsuite/23_containers/array/capacity/max_size.cc: Same. * testsuite/23_containers/array/capacity/size.cc: Same. * testsuite/23_containers/array/iterators/begin_end.cc: New test. 2022-02-02 Jonathan Wakely * testsuite/27_io/filesystem/iterators/error_reporting.cc: Use autoconf macro to check whether d_type is present. * testsuite/experimental/filesystem/iterators/error_reporting.cc: Likewise. 2022-02-01 Jonathan Wakely * testsuite/27_io/filesystem/iterators/97731.cc: New test. * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc: Check follow_directory_symlink option. * testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc: Likewise. 2022-02-01 Jonathan Wakely * src/c++17/fs_dir.cc (recursive_directory_iterator::increment): Reset state to past-the-end iterator on error. (fs::recursive_directory_iterator::pop(error_code&)): Likewise. (fs::recursive_directory_iterator::pop()): Check _M_dirs before it might get reset. * src/filesystem/dir.cc (recursive_directory_iterator): Likewise, for the TS implementation. * testsuite/27_io/filesystem/iterators/error_reporting.cc: New test. * testsuite/experimental/filesystem/iterators/error_reporting.cc: New test. 2022-02-01 Jonathan Wakely * include/bits/fs_fwd.h (filesystem::perms): Fix comment. 2022-02-01 Jonathan Wakely PR libstdc++/104301 * acinclude.m4 (GLIBCXX_ENABLE_CSTDIO): Print different messages for stdio_pure and stdio_posix options. * configure: Regenerate. 2022-02-01 Thomas Rodgers * include/bits/atomic_wait.h: Change memory order from Acquire/Release with relaxed loads to SeqCst+Release for accesses to the waiter's count. 2022-01-31 Martin Liska * acinclude.m4: Detect *_ld_is_mold and use it. * configure: Regenerate. 2022-01-30 Hans-Peter Nilsson * testsuite/27_io/basic_istream/get/char/lwg3464.cc: Don't run on simulator targets. * testsuite/27_io/basic_istream/get/wchar_t/lwg3464.cc: Likewise. 2022-01-27 Jonathan Wakely PR libstdc++/100516 * include/bits/deque.tcc (_M_range_initialize): Add __builtin_unreachable to loop. * testsuite/23_containers/deque/100516.cc: New test. 2022-01-27 Jonathan Wakely * include/bits/ranges_base.h (ranges::advance): Avoid signed overflow. Do nothing if already equal to desired result. * testsuite/24_iterators/range_operations/advance_overflow.cc: New test. 2022-01-27 Martin Liska PR libstdc++/104259 * acinclude.m4: Fix typo. * configure: Regenerate. 2022-01-25 Jonathan Wakely PR libstdc++/104019 * include/bits/istream.tcc (basic_istream::sentry): Add braces around try-block. * include/bits/shared_ptr_base.h (_Sp_counted_array_base::_M_init): Add pragmas to disable bogus warnings from PR 61596. 2022-01-25 Jonathan Wakely PR libstdc++/104217 * src/c++17/fs_ops.cc (_GNU_SOURCE): Define. * src/filesystem/dir.cc (_GNU_SOURCE): Define. * src/filesystem/ops.cc (_GNU_SOURCE): Define. 2022-01-25 Jonathan Wakely PR libstdc++/104161 * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for fdopendir. * config.h.in: Regenerate. * configure: Regenerate. * src/c++17/fs_dir.cc (_Dir): Add nofollow flag to constructor and pass it to base class constructor. (directory_iterator): Pass nofollow flag to _Dir constructor. (fs::recursive_directory_iterator::increment): Likewise. * src/c++17/fs_ops.cc (do_remove_all): Use nofollow option for directory_iterator constructor. Move error check outside loop. * src/filesystem/dir-common.h (_Dir_base): Add nofollow flag to constructor and when it's set use ::open with O_NOFOLLOW and O_DIRECTORY. * src/filesystem/dir.cc (_Dir): Add nofollow flag to constructor and pass it to base class constructor. (directory_iterator): Pass nofollow flag to _Dir constructor. (fs::recursive_directory_iterator::increment): Likewise. * src/filesystem/ops.cc (remove_all): Use nofollow option for directory_iterator constructor. Move error check outside loop. 2022-01-23 Jonathan Wakely PR libstdc++/104032 * include/std/spanstream (basic_spanbuf(basic_spanbuf&&)): Use mem-initializer for _M_buf. (basic_spanbuf::Operator=(basic_spanbuf&&)): Fix ill-formed member access. * testsuite/27_io/spanstream/2.cc: New test. 2022-01-23 Jonathan Wakely * src/c++17/floating_from_chars.cc (USE_STRTOD_FOR_FROM_CHARS): Define macro for case where std::from_chars is implemented in terms of strtod, strtof or strtold. (buffer_resource, valid_fmt, find_end_of_float, pattern) (from_chars_impl, make_result, reserve_string): Do not define unless USE_STRTOD_FOR_FROM_CHARS is defined. (from_chars): Define when at least one of USE_LIB_FAST_FLOAT and USE_STRTOD_FOR_FROM_CHARS is defined, instead of _GLIBCXX_HAVE_USELOCALE. Use fast_float for long double when it is binary64. 2022-01-23 Jonathan Wakely PR libstdc++/104174 * include/bits/hashtable_policy.h (_Map_base): Add partial specialization for maps with const key types. * testsuite/23_containers/unordered_map/104174.cc: New test. 2022-01-23 Jonathan Wakely PR libstdc++/104019 * include/bits/shared_ptr_base.h (_Sp_counted_base<>::_M_release): Set members to zero without type punning. 2022-01-21 Jonathan Wakely * testsuite/20_util/shared_ptr/cons/array.cc: Fix comment. 2022-01-21 Jonathan Wakely PR libstdc++/87193 PR libstdc++/104019 * include/bits/alloc_traits.h (__cpp_lib_allocator_traits_is_always_equal): Define as type long. * include/bits/allocator.h (__cpp_lib_incomplete_container_elements): Likewise. * include/bits/basic_string.h (__cpp_lib_string_udls): Likewise. * include/bits/chrono.h (__cpp_lib_chrono): Likewise. (__cpp_lib_chrono_udls): Likewise. * include/bits/move.h (__cpp_lib_addressof_constexpr): Likewise. * include/bits/node_handle.h (__cpp_lib_node_extract): Likewise. * include/bits/range_access.h (__cpp_lib_nonmember_container_access): Likewise. * include/bits/shared_ptr.h (__cpp_lib_enable_shared_from_this): Likewise. * include/bits/stl_algo.h (__cpp_lib_clamp): Likewise. (__cpp_lib_sample): Likewise. * include/bits/stl_algobase.h (__cpp_lib_robust_nonmodifying_seq_ops): Likewise. * include/bits/stl_function.h (__cpp_lib_transparent_operators): Likewise. * include/bits/stl_iterator.h (__cpp_lib_make_reverse_iterator): Likewise. * include/bits/stl_map.h (__cpp_lib_map_try_emplace): Likewise. * include/bits/stl_tree.h (__cpp_lib_generic_associative_lookup): Likewise. * include/bits/unique_ptr.h (__cpp_lib_make_unique): Likewise. * include/bits/unordered_map.h (__cpp_lib_unordered_map_try_emplace): Likewise. * include/c_global/cmath (__cpp_lib_hypot): Likewise. * include/c_global/cstddef (__cpp_lib_byte): Likewise. * include/std/atomic (__cpp_lib_atomic_is_always_lock_free): Likewise. * include/std/complex (__cpp_lib_complex_udls): Likewise. * include/std/filesystem (__cpp_lib_filesystem): Likewise. * include/std/functional (__cpp_lib_not_fn): Likewise. (__cpp_lib_boyer_moore_searcher): Likewise. * include/std/iomanip (__cpp_lib_quoted_string_io): Likewise. * include/std/mutex (__cpp_lib_scoped_lock): Likewise. * include/std/numeric (__cpp_lib_gcd_lcm): Likewise. (__cpp_lib_gcd, __cpp_lib_lcm): Likewise. * include/std/tuple (__cpp_lib_apply): Likewise. (__cpp_lib_make_from_tuple): Likewise. * include/std/type_traits (__cpp_lib_integral_constant_callable) (__cpp_lib_bool_constant, __cpp_lib_logical_traits) (__cpp_lib_is_null_pointer, __cpp_lib_transformation_trait_aliases) (__cpp_lib_result_of_sfinae, __cpp_lib_void_t) (__cpp_lib_is_swappable, __cpp_lib_is_invocable) (__cpp_lib_has_unique_object_representations) (__cpp_lib_is_aggregate): Likewise. * include/std/version: Likewise. * libsupc++/new (__cpp_lib_launder): Likewise. 2022-01-21 Jonathan Wakely * include/std/version (__cpp_lib_shared_ptr_arrays): Fix condition for C++17 definition. 2022-01-21 Jonathan Wakely * include/bits/shared_ptr_atomic.h (_Sp_atomic::_Atomic_count): Add constexpr. (_Sp_atomic::_M_ptr): Add default member-initializer. * testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: Check constant initialization. * testsuite/20_util/weak_ptr/atomic_weak_ptr.cc: Likewise. 2022-01-20 Jonathan Wakely * src/c++11/cxx11-ios_failure.cc (__constinit): Define as equivalent attribute for Clang. * src/c++11/future.cc (__constinit): Likewise. * src/c++11/system_error.cc (__constinit): Likewise. * src/c++17/memory_resource.cc (__constinit): Likewise. 2022-01-20 Jonathan Wakely * scripts/testsuite_flags.in: Only add src/filesystem/.libs and src/libbacktrace/.libs to LDFLAGS if those directories exist. 2022-01-19 Jonathan Wakely * configure.ac (GLIBCXX_ENABLE_DEBUG_FLAGS): Remove -gdwarf-4 from default flags. * configure: Regenerate. 2022-01-19 Jonathan Wakely PR libstdc++/104123 * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Include . 2022-01-19 Jonathan Wakely * scripts/testsuite_flags.in: Add src/libbacktrace/.libs to linker search paths. * src/Makefile.am: Fix src/debug/libbacktrace build. * src/Makefile.in: Regenerate. * src/libbacktrace/Makefile.am: Use per-library CPPFLAGS variable. Use symlinks for the source files. * src/libbacktrace/Makefile.in: Regenerate. 2022-01-19 Matthias Kretz * include/experimental/bits/simd.h (__floating_point_flags): Do not rely on math_errhandling to expand to a constant expression. 2022-01-19 Jonathan Wakely * doc/xml/manual/evolution.xml: Document deprecations. * doc/xml/manual/status_cxx2017.xml: Update status. * doc/html/*: Regenerate. 2022-01-19 Jonathan Wakely * include/bits/stl_tempbuf.h (get_temporary_buffer): Change _GLIBCXX14_DEPRECATED to _GLIBCXX17_DEPRECATED. 2022-01-19 Jonathan Wakely * include/bits/stl_pair.h (_PCC::_DeprConsPair): Remove unused function. 2022-01-19 Jonathan Wakely PR libstdc++/104101 * include/bits/shared_ptr_atomic.h (_Sp_atomic::_Atomic_count::lock): Only use __thread_relax if __cpp_lib_atomic_wait is defined. 2022-01-18 Jonathan Wakely PR libstdc++/104099 * include/bits/basic_string.h (basic_string(nullptr_t)): Only define for C++23. (operator=(nullptr_t)): Likewise. * include/bits/cow_string.h: Likewise. * include/std/string_view (basic_string_view(nullptr_t)): Likewise. * testsuite/21_strings/basic_string/cons/char/nullptr.cc: Adjust expected error. Add examples that become ill-formed in C++23. * testsuite/21_strings/basic_string_view/cons/char/nonnull.cc: Adjust expected errors. * testsuite/21_strings/basic_string_view/cons/wchar_t/nonnull.cc: Likewise. 2022-01-18 Jonathan Wakely PR libstdc++/104098 * include/bits/stl_iterator.h (reverse_iterator): Check __cpp_lib_concepts instead of __cplusplus. 2022-01-18 Jonathan Wakely PR libstdc++/101124 * include/bits/stl_pair.h (pair): Adjust constraints on deprecated constructors accepting literal zero as null pointer constant. Improve wording of deprecated attribute. * testsuite/20_util/pair/cons/99957.cc: Check that deprecated constructors do not cause ambiguities for copyable types. 2022-01-18 Jonathan Wakely * include/bits/stl_function.h (ptr_fun): Fix suggestion for non-deprecated alternative. 2022-01-18 Tom Honermann * acinclude.m4: Define config macros if uchar.h provides c8rtomb() and mbrtoc8(). * config.h.in: Regenerate. * configure: Regenerate. * include/c_compatibility/uchar.h (c8rtomb, mbrtoc8): Define. * include/c_global/cuchar (c8rtomb, mbrtoc8): Likewise. * include/c_std/cuchar (c8rtomb, mbrtoc8): Likewise. * testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc: New test. * testsuite/21_strings/headers/cuchar/functions_std_fchar8_t.cc: New test. 2022-01-18 Jonathan Wakely * include/Makefile.am: Install new header. * include/Makefile.in: Regenerate. * include/c_compatibility/stdatomic.h: New file. * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: New test. 2022-01-18 Jonathan Wakely PR libstdc++/104080 * src/c++17/fast_float/LOCAL_PATCHES: Update. * src/c++17/fast_float/fast_float.h (FASTFLOAT_IS_BIG_ENDIAN): Define in terms of __BYTE_ORDER__. 2022-01-18 Jonathan Wakely PR libstdc++/104080 * src/c++17/fast_float/LOCAL_PATCHES: UPDATE. * src/c++17/fast_float/fast_float.h (round): Use explicit template argument list for std::min. 2022-01-18 Jonathan Wakely * doc/xml/manual/status_cxx2017.xml: Update C++17 status. * doc/xml/manual/status_cxx2020.xml: Use 12.1 instead of 12 for upcoming release. * doc/html/manual/status.html: Regenerate. 2022-01-18 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING): Improve comments. * configure: Regenerate. 2022-01-17 Patrick Palka * src/c++17/floating_from_chars.cc: (USE_LIB_FAST_FLOAT): Conditionally define, and use it to conditionally include fast_float. (from_chars): Use fast_float for float and double when USE_LIB_FAST_FLOAT. 2022-01-17 Patrick Palka * src/c++17/fast_float/LOCAL_PATCHES: Update. * src/c++17/fast_float/fast_float.h (from_chars_advanced): In case of over/underflow, return errc::result_out_of_range and don't modify 'value'. 2022-01-17 Patrick Palka * src/c++17/fast_float/LOCAL_PATCHES: Update. * src/c++17/fast_float/fast_float.h: Apply local modifications. 2022-01-17 Patrick Palka * src/c++17/fast_float/LOCAL_PATCHES: New file. * src/c++17/fast_float/MERGE: New file. * src/c++17/fast_float/README.md: New file, copied from the fast_float repository. * src/c++17/fast_float/fast_float.h: New file, an amalgamation of the fast_float library. 2022-01-17 Patrick Palka * src/c++17/floating_from_chars.cc: Include . (ascii_to_hexit, starts_with_ci): Conditionally define. (__floating_from_chars_hex): Conditionally define. (from_chars): Use __floating_from_chars_hex for chars_format::hex parsing of binary32/64 float/double. (testsuite/20_util/from_chars/7.cc): New test. * testsuite/20_util/from_chars/7.cc: New file. 2022-01-17 Jonathan Wakely * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): New macro. * configure.ac: Use GLIBCXX_ENABLE_BACKTRACE. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/std/stacktrace: New header. * include/std/version (__cpp_lib_stacktrace): Define. * Makefile.in: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * python/Makefile.in: Regenerate. * src/Makefile.am: Regenerate. * src/Makefile.in: Regenerate. * src/c++11/Makefile.in: Regenerate. * src/c++17/Makefile.in: Regenerate. * src/c++20/Makefile.in: Regenerate. * src/c++98/Makefile.in: Regenerate. * src/filesystem/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * src/libbacktrace/Makefile.am: New file. * src/libbacktrace/Makefile.in: New file. * src/libbacktrace/backtrace-rename.h: New file. * src/libbacktrace/backtrace-supported.h.in: New file. * src/libbacktrace/config.h.in: New file. * testsuite/lib/libstdc++.exp (check_effective_target_stacktrace): New proc. * testsuite/20_util/stacktrace/entry.cc: New test. * testsuite/20_util/stacktrace/synopsis.cc: New test. * testsuite/20_util/stacktrace/version.cc: New test. 2022-01-17 Jonathan Wakely * doc/xml/manual/status_cxx2020.xml: Use final C++20 option names. * doc/html/manual/status.html: Regenerate. 2022-01-17 Jonathan Wakely PR libstdc++/103650 * include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS. * include/Makefile.in: Regenerate. * testsuite/17_intro/headers/c++1998/103650.cc: New test. 2022-01-17 Matthias Kretz * include/experimental/bits/simd.h (__floating_point_flags): Do not rely on the presence of the math_errhandling macro. 2022-01-17 Jonathan Wakely * include/bits/shared_ptr_atomic.h (_Sp_atomic): Add typename to qualified-id for dependent type. 2022-01-17 Jonathan Wakely * doc/xml/manual/status_cxx2020.xml: Update. * doc/html/manual/status.html: Regenerate. 2022-01-17 Jonathan Wakely Thomas Rodgers * include/bits/shared_ptr_atomic.h (__cpp_lib_atomic_shared_ptr): New macro. (_Sp_atomic): New class template. (atomic>, atomic>): New partial specializations. * include/bits/shared_ptr_base.h (__shared_count, __weak_count) (__shared_ptr, __weak_ptr): Declare _Sp_atomic as a friend. * include/std/version (__cpp_lib_atomic_shared_ptr): New macro. * testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc: New test. * testsuite/20_util/weak_ptr/atomic_weak_ptr.cc: New test. 2022-01-15 Matthias Kretz * include/experimental/bits/simd.h: Move feature detection bools and add __have_avx512bitalg, __have_avx512vbmi2, __have_avx512vbmi, __have_avx512ifma, __have_avx512cd, __have_avx512vnni, __have_avx512vpopcntdq. (__detail::__machine_flags): New function which returns a unique uint64 depending on relevant -m and -f flags. (__detail::__odr_helper): New type alias for either an anonymous type or a type specialized with the __machine_flags number. (_SimdIntOperators): Change template parameters from _Impl to _Tp, _Abi because _Impl now has an __odr_helper parameter which may be _OdrEnforcer from the anonymous namespace, which makes for a bad base class. (many): Either add __odr_helper template parameter or mark as always_inline. * include/experimental/bits/simd_detail.h: Add defines for AVX512BITALG, AVX512VBMI2, AVX512VBMI, AVX512IFMA, AVX512CD, AVX512VNNI, AVX512VPOPCNTDQ, and AVX512VP2INTERSECT. * include/experimental/bits/simd_builtin.h: Add __odr_helper template parameter or mark as always_inline. * include/experimental/bits/simd_fixed_size.h: Ditto. * include/experimental/bits/simd_math.h: Ditto. * include/experimental/bits/simd_scalar.h: Ditto. * include/experimental/bits/simd_neon.h: Add __odr_helper template parameter. * include/experimental/bits/simd_ppc.h: Ditto. * include/experimental/bits/simd_x86.h: Ditto. 2022-01-14 Uroš Bizjak * testsuite/22_locale/numpunct/members/char/3.cc: Require pt_PT locale instead of nl_NL. (test02): Use pt_PT locale instead of nl_NL. 2022-01-14 Jonathan Wakely PR libstdc++/91260 PR libstdc++/91383 PR libstdc++/95065 * include/backward/binders.h (bind1st, bind2nd): Add deprecated attribute. * include/bits/refwrap.h (_Maybe_unary_or_binary_function): Disable deprecated warnings for base classes. (_Reference_wrapper_base): Likewise. * include/bits/shared_ptr_base.h (_Sp_owner_less): Likewise. * include/bits/stl_bvector.h (_Bit_iterator_base): Likewise. * include/bits/stl_function.h (unary_function, binary_function): Add deprecated attribute. (unary_negate, not1, binary_negate, not2, ptr_fun) (pointer_to_unary_function, pointer_to_binary_function) (mem_fun_t, const_mem_fun_t, mem_fun_ref_t, const_mem_fun_ref_t) (mem_fun1_t, const_mem_fun1_t, mem_fun_ref1_t) (const_mem_fun1_ref_t, mem_fun, mem_fun_ref): Add deprecated attributes. * include/bits/stl_iterator.h: Disable deprecated warnings for std::iterator base classes. * include/bits/stl_iterator_base_types.h (iterator): Add deprecated attribute. * include/bits/stl_map.h (map::value_compare): Disable deprecated warnings for base class. * include/bits/stl_multimap.h (multimap::value_compare): Likewise. * include/bits/stl_raw_storage_iter.h (raw_storage_iterator): Add deprecated attribute. * include/bits/stl_tempbuf.h (get_temporary_buffer): Likewise. * include/bits/stream_iterator.h: Disable deprecated warnings. * include/bits/streambuf_iterator.h: Likewise. * include/ext/bitmap_allocator.h: Remove unary_function base classes. * include/ext/functional: Disable deprecated warnings. * include/ext/rope: Likewise. * include/ext/throw_allocator.h: Likewise. * include/std/type_traits (result_of): Add deprecated attribute. * include/tr1/functional: Disable deprecated warnings. * include/tr1/functional_hash.h: Likewise. * testsuite/20_util/function_objects/binders/1.cc: Add -Wno-disable-deprecations. * testsuite/20_util/function_objects/binders/3113.cc: Likewise. * testsuite/20_util/function_objects/constexpr.cc: Add dg-warning. * testsuite/20_util/raw_storage_iterator/base.cc: Likewise. * testsuite/20_util/raw_storage_iterator/dr2127.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc: Likewise. * testsuite/20_util/reference_wrapper/24803.cc: Likewise. * testsuite/20_util/reference_wrapper/typedefs.cc: Enable for C++20 and check for absence of nested types. * testsuite/20_util/shared_ptr/comparison/less.cc: Remove std::binary_function base class. * testsuite/20_util/temporary_buffer.cc: Add dg-warning. * testsuite/21_strings/basic_string/cons/char/69092.cc: Remove std::iterator base class. * testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/istream_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/istreambuf_iterator/92285.cc: Likewise. * testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc: Likewise. * testsuite/25_algorithms/copy/34595.cc: Likewise. * testsuite/25_algorithms/minmax/3.cc: Remove std::binary_function base class. * testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc: Disable deprecated warnings. * testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc: Add dg-warning. * testsuite/ext/pb_ds/example/priority_queue_erase_if.cc: Likewise. * testsuite/ext/pb_ds/example/priority_queue_split_join.cc: Likewise. * testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc: Disable deprecated warnings. * testsuite/tr1/6_containers/hash/requirements/base_classes.cc: Likewise. * testsuite/util/regression/trait/erase_if_fn.hpp: Remove std::unary_function base classes. * testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Remove std::iterator base classes. 2022-01-14 Jonathan Wakely * include/bits/shared_ptr.h (__cpp_lib_shared_ptr_weak_type): Correct type of macro value. (shared_ptr): Add additional friend declarations. (make_shared, allocate_shared): Constrain existing overloads and remove static_assert. * include/bits/shared_ptr_base.h (__cpp_lib_smart_ptr_for_overwrite): New macro. (_Sp_counted_ptr_inplace): New partial specialization for use with make_shared_for_overwrite. (__cpp_lib_shared_ptr_arrays): Update value for C++20. (_Sp_counted_array_base): New class template. (_Sp_counted_array): New class template. (__shared_count(_Tp*&, const _Sp_counted_array_base&, _Init)): New constructor for allocating shared arrays. (__shared_ptr(const _Sp_counted_array_base&, _Init)): Likewise. * include/std/version (__cpp_lib_shared_ptr_weak_type): Correct type. (__cpp_lib_shared_ptr_arrays): Update value for C++20. (__cpp_lib_smart_ptr_for_overwrite): New macro. * testsuite/20_util/shared_ptr/creation/99006.cc: Adjust expected errors. * testsuite/20_util/shared_ptr/creation/array.cc: New test. * testsuite/20_util/shared_ptr/creation/overwrite.cc: New test. * testsuite/20_util/shared_ptr/creation/version.cc: New test. * testsuite/20_util/unique_ptr/creation/for_overwrite.cc: Check feature test macro. Test non-trivial default-initialization. 2022-01-14 Jonathan Wakely * include/bits/stl_construct.h (_Construct, _Construct_novalue): Also cast away cv-qualifiers when converting pointer to void. * testsuite/20_util/allocator/void.cc: Test construct function with cv-qualified types. 2022-01-14 Jonathan Wakely PR libstdc++/103992 * include/bits/stl_iterator.h (common_iterator): Use std::construct_at instead of placement new. * testsuite/24_iterators/common_iterator/1.cc: Check copy construction is usable in constant expressions. 2022-01-14 Jonathan Wakely * doc/xml/manual/status_cxx2011.xml: Document new tokens accepted by std::random_device constructor. * doc/html/manual/status.html: Regenerate. 2022-01-12 Patrick Palka * testsuite/20_util/to_chars/103955.cc: Add explicit dg-do directive. 2022-01-12 Patrick Palka PR libstdc++/103955 * src/c++17/floating_to_chars.cc (__floating_to_chars_hex): Track the excess precision separately from the effective precision. Avoid overflow in bounds check by splitting it into two checks. (__floating_to_chars_precision): Avoid overflow in bounds checks similarly. * testsuite/20_util/to_chars/103955.cc: New test. 2022-01-11 Jonathan Wakely PR libstdc++/103726 * include/Makefile.am: Install for freestanding. * include/Makefile.in: Regenerate. * include/std/version (__cpp_lib_source_location): Define for freestanding. 2022-01-11 Jonathan Wakely * include/std/ranges (ranges::lazy_split_view::_InnerIter::end()): Add neoxcept (LWG 3593). 2022-01-11 Jonathan Wakely * include/std/ranges (ranges::__detail::__box): Add constexpr to assignment operators (LWG 3572). * testsuite/std/ranges/adaptors/filter.cc: Check assignment of a view that uses copyable-box. 2022-01-11 Jonathan Wakely PR libstdc++/103726 * include/Makefile.am: Install for freestanding. * include/Makefile.in: Regenerate. * include/std/coroutine: Adjust headers and preprocessor conditions. (__coroutine_traits_impl): Use concepts when available. [_GLIBCXX_HOSTED] (hash): Define. 2022-01-11 Jonathan Wakely * include/std/ostream (operator<<(basic_ostream&, charT)): Use unformatted input if no padding is needed. (operator<<(basic_ostream&, char)): Likewise. 2022-01-11 Jonathan Wakely PR libstdc++/103891 * include/bits/c++config (_GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS): Define. * include/std/variant (__cpp_lib_variant): Only define C++20 value when the compiler is known to support conditionally trivial destructors. * include/std/version (__cpp_lib_variant): Likewise. 2022-01-11 Jonathan Wakely * include/bits/stl_iterator.h (common_iterator): Add constexpr to all member functions (LWG 3574). * testsuite/24_iterators/common_iterator/1.cc: Evaluate some tests as constant expressions. * testsuite/24_iterators/common_iterator/2.cc: Likewise. 2022-01-10 Jakub Jelinek PR libstdc++/77760 * include/bits/locale_facets_nonio.h (__time_get_state): New struct. (time_get::_M_extract_via_format): Declare new method with __time_get_state& as an extra argument. * include/bits/locale_facets_nonio.tcc (_M_extract_via_format): Add __state argument, set various fields in it while parsing. Handle %j, %U, %w and %W, fix up handling of %y, %Y and %C, don't adjust tm_hour for %p immediately. Add a wrapper around the method without the __state argument for backwards compatibility. (_M_extract_num): Remove all __len == 4 special cases. (time_get::do_get_time, time_get::do_get_date, time_get::do_get): Zero initialize __state, pass it to _M_extract_via_format and finalize it at the end. (do_get_year): For 1-2 digit parsed years, map 0-68 to 2000-2068, 69-99 to 1969-1999. For 3-4 digit parsed years use that as year. (get): If do_get isn't overloaded from the locale_facets_nonio.tcc version, don't call do_get but call _M_extract_via_format instead to pass around state. * config/abi/pre/gnu.ver (GLIBCXX_3.4.30): Export _M_extract_via_format with extra __time_get_state and __time_get_state::_M_finalize_state. * src/c++98/locale_facets.cc (is_leap, day_of_the_week, day_of_the_year): New functions in anon namespace. (mon_yday): New var in anon namespace. (__time_get_state::_M_finalize_state): Define. * testsuite/22_locale/time_get/get/char/4.cc: New test. * testsuite/22_locale/time_get/get/wchar_t/4.cc: New test. * testsuite/22_locale/time_get/get_year/char/1.cc (test01): Parse 197 as year 197AD instead of error. * testsuite/22_locale/time_get/get_year/char/5.cc (test01): Parse 1 as year 2001 instead of error. * testsuite/22_locale/time_get/get_year/char/6.cc: New test. * testsuite/22_locale/time_get/get_year/wchar_t/1.cc (test01): Parse 197 as year 197AD instead of error. * testsuite/22_locale/time_get/get_year/wchar_t/5.cc (test01): Parse 1 as year 2001 instead of error. * testsuite/22_locale/time_get/get_year/wchar_t/6.cc: New test. 2022-01-10 Jonathan Wakely PR libstdc++/103866 * acinclude.m4 (GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS): Do nothing for freestanding builds. (GLIBCXX_ENABLE_HOSTED): Define FREESTANDING_FLAGS. * configure.ac: Do not use AC_LIBTOOL_DLOPEN when configured with --without-headers. Do not use GCC_HEADER_STDINT for freestanding builds. * libsupc++/Makefile.am (HOSTED_CXXFLAGS): Use -ffreestanding for freestanding builds. * configure: Regenerate. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * python/Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * src/c++11/Makefile.in: Regenerate. * src/c++17/Makefile.in: Regenerate. * src/c++20/Makefile.in: Regenerate. * src/c++98/Makefile.in: Regenerate. * src/filesystem/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. 2022-01-10 Jonathan Wakely * testsuite/28_regex/algorithms/regex_replace/char/103664.cc: Add dg-timeout-factor directive. * testsuite/28_regex/basic_regex/84110.cc: Likewise. * testsuite/28_regex/basic_regex/ctors/char/other.cc: Likewise. * testsuite/28_regex/match_results/102667.cc: Likewise. 2022-01-10 Jonathan Wakely * doc/xml/manual/using.xml: Update documentation around default -std option. * doc/html/*: Regenerate. 2022-01-10 Jonathan Wakely PR libstdc++/100017 * src/c++17/Makefile.am (AM_CXXFLAGS): Add -nostdinc++. * src/c++17/Makefile.in: Regenerate. 2022-01-09 Sandra Loosemore * testsuite/18_support/type_info/constexpr.cc: Add explicit -fdelete-null-pointer-checks option. 2022-01-06 Pavel I. Kryukov Jonathan Wakely PR libstdc++/103853 * include/bits/forward_list.tcc (forward_list::merge): Check for self-merge. * testsuite/23_containers/forward_list/operations/merge.cc: New test. 2022-01-06 Jonathan Wakely * include/bits/regex.h (basic_regex, match_results): Qualify name in friend declaration, to work around Clang bug. 2022-01-06 Jonathan Wakely * testsuite/ext/rope/pthread7-rope.cc: Add dg-timeout-factor. 2022-01-06 Jonathan Wakely PR libstdc++/103911 * include/std/charconv (__from_chars_alpha_to_num): Return char instead of unsigned char. Change invalid return value to 127 instead of using numeric trait. (__from_chars_alnum): Fix comment. Do not use std::isdigit. Change type of variable to char. 2022-01-05 François Dumont PR libstdc++/68303 * include/bits/hashtable_policy.h (_Hashtable_hash_traits<_Hash>): New. (_Hash_code_base<>::_M_hash_code(const _Hash_node_value<>&)): New. (_Hashtable_base<>::_M_key_equals): New. (_Hashtable_base<>::_M_equals): Use latter. (_Hashtable_base<>::_M_key_equals_tr): New. (_Hashtable_base<>::_M_equals_tr): Use latter. * include/bits/hashtable.h (_Hashtable<>::__small_size_threshold()): New, use _Hashtable_hash_traits. (_Hashtable<>::find): Loop through elements to look for key if size is lower than __small_size_threshold(). (_Hashtable<>::_M_emplace(true_type, _Args&&...)): Likewise. (_Hashtable<>::_M_insert_unique(_Kt&&, _Args&&, const _NodeGenerator&)): Likewise. (_Hashtable<>::_M_compute_hash_code(const_iterator, const key_type&)): New. (_Hashtable<>::_M_emplace(const_iterator, false_type, _Args&&...)): Use latter. (_Hashtable<>::_M_find_before_node(const key_type&)): New. (_Hashtable<>::_M_erase(true_type, const key_type&)): Use latter. (_Hashtable<>::_M_erase(false_type, const key_type&)): Likewise. * src/c++11/hashtable_c++0x.cc: Include . * testsuite/util/testsuite_performance.h (report_performance): Use 9 width to display memory. * testsuite/performance/23_containers/insert_erase/unordered_small_size.cc: New performance test case. 2022-01-05 Jonathan Wakely PR libstdc++/103919 * include/bits/basic_string.h (basic_string(const T&, size_t, size_t)): Relax constraints on string_view parameter. * include/bits/cow_string.h (basic_string(const T&, size_t, size_t)): Likewise. * testsuite/21_strings/basic_string/cons/char/103919.cc: New test. 2022-01-05 Jonathan Wakely * config/abi/pre/gnu.ver (GLIBCXX_3.4.30): Export new symbol for ARM EABI. * include/bits/c++config (_GLIBCXX23_CONSTEXPR): Define. * include/std/version (__cpp_lib_constexpr_typeinfo): Define. * libsupc++/tinfo.cc: Add #error to ensure non-inline definition is emitted. (type_info::__equal): Define alias symbol. * libsupc++/typeinfo (type_info::before): Combine different implementations into one. (type_info::operator==): Likewise. Use address equality for constant evaluation. Call __equal for targets that require the definition to be non-inline. * testsuite/18_support/type_info/constexpr.cc: New test. 2022-01-05 Jonathan Wakely * src/c++11/cxx11-ios_failure.cc (io_error_category): Define class and virtual functions as 'final'. (io_category_instance): Use constinit union to make the object immortal. * src/c++11/future.cc (future_error_category): Define class and virtual functions as 'final'. (future_category_instance): Use constinit union. 2022-01-05 Jonathan Wakely * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Strip versioned namespace from the type name that is printed. 2022-01-05 Jonathan Wakely * python/libstdcxx/v6/printers.py (StdRegexStatePrinter): New printer for std::regex NFA states. 2022-01-05 Jonathan Wakely * testsuite/23_containers/forward_list/operations/1.cc: Fill in placeholders in comments. * testsuite/23_containers/forward_list/operations/2.cc: Likewise. * testsuite/23_containers/forward_list/operations/3.cc: Likewise. * testsuite/23_containers/forward_list/operations/4.cc: Likewise. * testsuite/23_containers/forward_list/operations/5.cc: Likewise. * testsuite/23_containers/forward_list/operations/6.cc: Likewise. * testsuite/23_containers/forward_list/operations/7.cc: Likewise. 2022-01-05 Jonathan Wakely PR libstdc++/103848 * include/bits/stl_deque.h (operator-): Do not use 0 as null pointer constant. 2022-01-05 Jonathan Wakely * include/bits/alloc_traits.h (allocator_traits>): Use std::_Construct for construct. 2022-01-05 Jonathan Wakely PR libstdc++/103877 * doc/xml/faq.xml: Add '-x c++' to preprocessor command. * doc/html/faq.html: Regenerate. 2022-01-05 Jonathan Wakely * include/bits/regex.h (__regex_algo_impl): Change __policy and __match_mode template parameters to be function parameters. (regex_match, regex_search): Pass policy and match mode as function arguments. * include/bits/regex.tcc (__regex_algo_impl): Change template parameters to function parameters. * include/bits/regex_compiler.h (_RegexTranslatorBase): Use 'if constexpr' for conditions using template parameters. (_RegexTranslator): Likewise. * include/bits/regex_executor.tcc (_Executor::_M_handle_accept): Likewise. * testsuite/util/testsuite_regex.h (regex_match_debug) (regex_search_debug): Move template arguments to function arguments. 2022-01-05 Jonathan Wakely * testsuite/util/testsuite_regex.h (regex_match_debug): Compare results even if the match failed. 2022-01-05 Jonathan Wakely * include/bits/regex_compiler.tcc: Adjust all calls to __throw_regex_error. * include/bits/regex_error.h (__throw_regex_error): Add noreturn attribute. * include/bits/regex_scanner.tcc: Likewise. * src/c++11/regex.cc (desc): New helper function. (regex_error::regex_error(error_type)): Use desc to get a string corresponding to the error code. Copyright (C) 2022 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.