aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
AgeCommit message (Collapse)AuthorFilesLines
2023-11-08Daily bump.GCC Administrator1-0/+14
2023-11-07libstdc++: [_Hashtable] Add missing node destructor callFrançois Dumont1-4/+5
libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (_Hashtable_alloc<>::_M_allocate_node): Add missing call to node destructor on construct exception.
2023-11-07libstdc++/112351 - deal with __gthread_once failure during locale initRichard Biener1-5/+8
The following makes the C++98 locale init path follow the way the C++11 performs initialization. This way we deal with pthread_once failing, falling back to non-threadsafe initialization which, given we initialize from the library, should be serialized by the dynamic loader already. PR libstdc++/112351 libstdc++-v3/ * src/c++98/locale.cc (locale::facet::_S_initialize_once): Check whether _S_c_locale is already initialized. (locale::facet::_S_get_c_locale): Always perform non-threadsafe init when threadsafe init failed.
2023-11-07Daily bump.GCC Administrator1-0/+15
2023-11-06libstdc++: use -D_GNU_SOURCE when building libbacktraceIan Lance Taylor2-2/+8
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-11-06libstdc++: Improve static assert messages for monadic operationsJonathan Wakely2-22/+66
The monadic operations for std::optional and std::expected make use of internal helper traits __is_optional nad __is_expected, which are not very user-friendly when shown in diagnostics. Add messages to the assertions explaining the problem more clearly. libstdc++-v3/ChangeLog: * include/std/expected (expected::and_then, expected::or_else): Add string literals to static assertions. * include/std/optional (optional::and_then, optional::or_else): Likewise.
2023-11-05Daily bump.GCC Administrator1-0/+21
2023-11-04libstdc++: Remove redundant partial specialization in _Nth_typeFeng Jisen1-4/+0
libstdc++-v3/ChangeLog: * include/bits/utility.h (_Nth_type): Remove redundant partial specialization.
2023-11-04libstdc++: Use strerror_r in std::generic_category()::message(int) [PR110133]Jonathan Wakely2-10/+72
Use strerror_r instead of strerror when available, due to the latter not being thread-safe. This is complicated by Glibc providing a GNU-specific strerror_r which is not compatible with POSIX strerror_r, so we need to dispatch on the return type. We can use the recently-added std::string::__resize_and_overwrite to write directly into the string buffer when possible. Because we estimate the initial buffer size we might end up with excess capacity in the returned std::string. We can slightly tweak the std::system_error constructors to make use of that excess capacity, so that in some cases we require fewer allocations to construct the std::system_error::what() string. libstdc++-v3/ChangeLog: PR libstdc++/110133 * include/std/system_error (system_error::system_error): Group arguments so that concatenation can reuse rvalue's capacity. * src/c++11/system_error.cc (strerror_string): New function. [_GLIBCXX_HAVE_STRERROR_R] (use_strerror_result): New functions. (generic_error_category::message): Use strerror_string. (system_error_category::message): Likewise.
2023-11-04libstdc++: Replace "_N" in examples of naming conventionsJonathan Wakely2-4/+4
The name "_N" is listed as a reserved name on Solaris, so we shouldn't use it as an example of our naming conventions. libstdc++-v3/ChangeLog: * doc/xml/manual/appendix_contributing.xml: Replace example that uses a BADNAME. * doc/html/manual/source_code_style.html: Regenerate.
2023-11-03Daily bump.GCC Administrator1-0/+15
2023-11-02libstdc++: Add assertion to std::string_view::remove_suffix [PR112314]Jonathan Wakely3-1/+32
libstdc++-v3/ChangeLog: 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-11-02libstdc++: Fix warning during configureJonathan Wakely2-6/+6
The checks for snprintf give a -Wformat warning due to a missing argument. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_C99): Fix snprintf checks. * configure: Regenerate.
2023-10-31Daily bump.GCC Administrator1-0/+11
2023-10-30libstdc++: [_GLIBCXX_INLINE_VERSION] Add comment on emul TLS symbolsFrançois Dumont1-0/+2
libstdc++-v3/ChangeLog: * config/abi/pre/gnu-versioned-namespace.ver: Add comment on recently added emul TLS symbols.
2023-10-30libstdc++: [_GLIBCXX_INLINE_VERSION] Un-weak handle_contract_violationFrançois Dumont1-2/+3
libstdc++-v3/ChangeLog: * src/experimental/contract.cc [_GLIBCXX_INLINE_VERSION](handle_contract_violation): Rework comment. Remove weak attribute.
2023-10-30Daily bump.GCC Administrator1-0/+11
2023-10-29libstdc++: [_GLIBCXX_INLINE_VERSION] Add emul TLS symbolsFrançois Dumont1-0/+2
libstdc++-v3/ChangeLog: * config/abi/pre/gnu-versioned-namespace.ver: Add missing emul TLS symbols.
2023-10-29libstdc++: [_GLIBCXX_INLINE_VERSION] Provide handle_contract_violation symbolFrançois Dumont1-0/+8
libstdc++-v3/ChangeLog: * src/experimental/contract.cc [_GLIBCXX_INLINE_VERSION](handle_contract_violation): Provide symbol without version namespace decoration for gcc.
2023-10-27Daily bump.GCC Administrator1-0/+30
2023-10-26libstdc++: Fix exception thrown by std::shared_lock::unlock() [PR112089]Jonathan Wakely2-1/+24
The incorrect errc constant here looks like a copy&paste error. libstdc++-v3/ChangeLog: 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.
2023-10-26libstdc++: Add dg-timeout-factor to <chrono> IO testsJonathan Wakely19-0/+19
This avoids failures due to compilation timeouts when testing with a low tool_timeout value. libstdc++-v3/ChangeLog: * testsuite/20_util/duration/io.cc: Double timeout using dg-timeout-factor. * testsuite/std/time/day/io.cc: Likewise. * testsuite/std/time/format.cc: Likewise. * testsuite/std/time/hh_mm_ss/io.cc: Likewise. * testsuite/std/time/month/io.cc: Likewise. * testsuite/std/time/month_day/io.cc: Likewise. * testsuite/std/time/month_day_last/io.cc: Likewise. * testsuite/std/time/month_weekday/io.cc: Likewise. * testsuite/std/time/month_weekday_last/io.cc: Likewise. * testsuite/std/time/weekday/io.cc: Likewise. * testsuite/std/time/weekday_indexed/io.cc: Likewise. * testsuite/std/time/weekday_last/io.cc: Likewise. * testsuite/std/time/year/io.cc: Likewise. * testsuite/std/time/year_month/io.cc: Likewise. * testsuite/std/time/year_month_day/io.cc: Likewise. * testsuite/std/time/year_month_day_last/io.cc: Likewise. * testsuite/std/time/year_month_weekday/io.cc: Likewise. * testsuite/std/time/year_month_weekday_last/io.cc: Likewise. * testsuite/std/time/zoned_time/io.cc: Likewise.
2023-10-26Daily bump.GCC Administrator1-0/+7
2023-10-25libstdc++: Build libstdc++_libbacktrace.a as PIC [PR111936]Jonathan Wakely2-5/+10
In order for std::stacktrace to be used in a shared library, the libbacktrace symbols need to be built with -fPIC. Add the libtool -prefer-pic flag to the commands in src/libbacktrace/Makefile so that the archive contains PIC objects. libstdc++-v3/ChangeLog: PR libstdc++/111936 * src/libbacktrace/Makefile.am: Add -prefer-pic to libtool compile commands. * src/libbacktrace/Makefile.in: Regenerate.
2023-10-25Daily bump.GCC Administrator1-0/+6
2023-10-24libstdc++: Include cstdarg in freestandingPaul M. Bendixen2-6/+6
P1642 includes cstdarg in the full headers to include. This commit includes it along with cstdalign and cstdbool that were left out when updating in an earlier commit. libstdc++/Changelog * include/Makefile.am: Move cstdarg, cstdalign and cstdbool to freestanding. * include/Makefile.in: Regenerate. Signed-off-by: Paul M. Bendixen <paulbendixen@gmail.com>
2023-10-23Daily bump.GCC Administrator1-0/+7
2023-10-22Config,Darwin: Allow for configuring Darwin to use embedded runpath.Iain Sandoe4-16/+141
Recent Darwin versions place contraints on the use of run paths specified in environment variables. This breaks some assumptions in the GCC build. This change allows the user to configure a Darwin build to use '@rpath/libraryname.dylib' in library names and then to add an embedded runpath to executables (and libraries with dependents). The embedded runpath is added by default unless the user adds '-nodefaultrpaths' to the link line. For an installed compiler, it means that any executable built with that compiler will reference the runtimes installed with the compiler (equivalent to hard-coding the library path into the name of the library). During build-time configurations any "-B" entries will be added to the runpath thus the newly-built libraries will be found by exes. Since the install name is set in libtool, that decision needs to be available here (but might also cause dependent ones in Makefiles, so we need to export a conditional). This facility is not available for Darwin 8 or earlier, however the existing environment variable runpath does work there. We default this on for systems where the external DYLD_LIBRARY_PATH does not work and off for Darwin 8 or earlier. For systems that can use either method, if the value is unset, we use the default (which is currently DYLD_LIBRARY_PATH). ChangeLog: * configure: Regenerate. * configure.ac: Do not add default runpaths to GCC exes when we are building -static-libstdc++/-static-libgcc (the default). * libtool.m4: Add 'enable-darwin-at-runpath'. Act on the enable flag to alter Darwin libraries to use @rpath names. gcc/ChangeLog: * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * config/darwin.h: Handle Darwin rpaths. * config/darwin.opt: Handle Darwin rpaths. * Makefile.in: Handle Darwin rpaths. gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Handle Darwin rpaths. gcc/jit/ChangeLog: * Make-lang.in: Handle Darwin rpaths. libatomic/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libbacktrace/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. libgcc/ChangeLog: * config/t-slibgcc-darwin: Generate libgcc_s with an @rpath name. * config.host: Handle Darwin rpaths. libgfortran/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libgm2/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libm2cor/Makefile.am: Handle Darwin rpaths. * libm2cor/Makefile.in: Regenerate. * libm2iso/Makefile.am: Handle Darwin rpaths. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.am: Handle Darwin rpaths. * libm2log/Makefile.in: Regenerate. * libm2min/Makefile.am: Handle Darwin rpaths. * libm2min/Makefile.in: Regenerate. * libm2pim/Makefile.am: Handle Darwin rpaths. * libm2pim/Makefile.in: Regenerate. libgomp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libitm/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libobjc/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libdruntime/Makefile.am: Handle Darwin rpaths. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libquadmath/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libsanitizer/ChangeLog: * asan/Makefile.am: Handle Darwin rpaths. * asan/Makefile.in: Regenerate. * configure: Regenerate. * hwasan/Makefile.am: Handle Darwin rpaths. * hwasan/Makefile.in: Regenerate. * lsan/Makefile.am: Handle Darwin rpaths. * lsan/Makefile.in: Regenerate. * tsan/Makefile.am: Handle Darwin rpaths. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.am: Handle Darwin rpaths. * ubsan/Makefile.in: Regenerate. libssp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libstdc++-v3/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libvtv/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. lto-plugin/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. zlib/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths.
2023-10-22Daily bump.GCC Administrator1-0/+28
2023-10-21libstdc++: Split std::basic_string::_M_use_local_data into two functionsJonathan Wakely2-15/+26
This splits out the activate-the-union-member-for-constexpr logic from _M_use_local_data, so that it can be used separately in cases that don't need to use std::pointer_traits<pointer>::pointer_to to obtain the return value. This leaves only three uses of _M_use_local_data() which are all of the same form: __s._M_data(_M_use_local_data()); __s._M_set_length(0); We could remove _M_use_local_data() and change those three places to use a new _M_reset() function that does: _M_init_local_buf(); _M_data(_M_local_data()); _M_set_length(0); This is left for a future change. libstdc++-v3/ChangeLog: * include/bits/basic_string.h (_M_init_local_buf()): New function. (_M_use_local_data()): Use _M_init_local_buf. (basic_string(), basic_string(const Alloc&)) (basic_string(basic_string&&)) (basic_string(basic_string&&, const Alloc&)): Use _M_init_local_buf instead of _M_use_local_data(). * include/bits/basic_string.tcc (swap(basic_string&)) (_M_construct(InIter, InIter, input_iterator_tag)) (_M_construct(InIter, InIter, forward_iterator_tag)) (_M_construct(size_type, CharT), reserve()): Likewise.
2023-10-21libstdc++: Workaround for LLVM-61763 in <ranges>Benjamin Brock1-0/+10
This patch adds a small workaround that avoids declaring constrained friends when compiling with Clang, instead making some members public. MSVC's standard library has implemented a similar workaround. Signed-off-by: Benjamin Brock <brock@cs.berkeley.edu> libstdc++-v3/ChangeLog: * include/std/ranges (zip_view, adjacent_view): Implement workaround for LLVM-61763.
2023-10-21libstdc++: testsuite: Enhance codecvt_unicode with tests for length()Dimitrij Mijoski1-13/+110
We can test codecvt::length() with the same data that we test codecvt::in(). For each call of in() we add another call to length(). Some additional small cosmentic changes are applied. libstdc++-v3/ChangeLog: * testsuite/22_locale/codecvt/codecvt_unicode.h: Test length()
2023-10-21libstdc++: Fix formatting of filesystem directory iteratorsJonathan Wakely1-8/+8
Fix indentation. libstdc++-v3/ChangeLog: * include/bits/fs_dir.h (operator==(default_sentinel_t)): Fix indentation.
2023-10-21Daily bump.GCC Administrator1-0/+5
2023-10-20libstdc++: add casts to from_chars in <charconv> [PR111883]Marek Polacek1-6/+6
This fixes .../charconv: In function 'std::from_chars_result std::from_chars(const char*, const char*, _Float16&, chars_format)': .../charconv:687:17: warning: converting to '_Float16' from 'float' with greater conversion rank 687 | __value = __val; | ^~~~~ .../charconv: In function 'std::from_chars_result std::from_chars(const char*, const char*, __gnu_cxx::__bfloat16_t&, chars_format)': .../charconv:763:17: warning: converting to '__gnu_cxx::__bfloat16_t' {aka '__bf16'} from 'float' with greater conversion rank 763 | __value = __val; | ^~~~~ which was breaking a test: FAIL: g++.dg/warn/Wstringop-overflow-6.C -std=gnu++26 (test for excess errors) PR testsuite/111883 libstdc++-v3/ChangeLog: * include/std/charconv (from_chars): Add explicit casts.
2023-10-20Daily bump.GCC Administrator1-0/+11
2023-10-19libstdc++: [_Hashtable] Do not reuse untrusted cached hash codeFrançois Dumont3-20/+190
On merge, reuse a merged node's possibly cached hash code only if we are on the same type of hash and this hash is stateless. Usage of function pointers or std::function as hash functor will prevent reusing cached hash code. libstdc++-v3/ChangeLog * 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-14Daily bump.GCC Administrator1-0/+27
2023-10-13libstdc++: Fix tr1/8_c_compatibility/cstdio/functions.cc regression with ↵Jakub Jelinek2-2/+2
recent glibc The following testcase started FAILing recently after the https://sourceware.org/git/?p=glibc.git;a=commit;h=64b1a44183a3094672ed304532bedb9acc707554 glibc change which marked vfscanf with nonnull (1) attribute. While vfwscanf hasn't been marked similarly (strangely), the patch changes that too. By using va_arg one hides the value of it from the compiler (volatile keyword would do too, or making the FILE* stream a function argument, but then it might need to be guarded by #if or something). 2023-10-13 Jakub Jelinek <jakub@redhat.com> * 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-10-13testsuite: Replace many dg-require-thread-fence with ↵Hans-Peter Nilsson9-9/+9
dg-require-atomic-cmpxchg-word These tests actually use a form of atomic compare and exchange operation, not just atomic loading and storing. Some targets (not supported by e.g. libatomic) have atomic loading and storing, but not compare and exchange, yielding linker errors for missing library functions. This change is just for existing uses of dg-require-thread-fence. It does not fix any other tests that should also be gated on dg-require-atomic-cmpxchg-word. * testsuite/29_atomics/atomic/compare_exchange_padding.cc, testsuite/29_atomics/atomic_flag/clear/1.cc, testsuite/29_atomics/atomic_flag/cons/value_init.cc, testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc, testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc, testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc, testsuite/29_atomics/atomic_ref/generic.cc, testsuite/29_atomics/atomic_ref/integral.cc, testsuite/29_atomics/atomic_ref/pointer.cc: Replace dg-require-thread-fence with dg-require-atomic-cmpxchg-word.
2023-10-13testsuite: Add dg-require-atomic-cmpxchg-wordHans-Peter Nilsson2-0/+46
Some targets (armv6-m) support inline atomic load and store, i.e. dg-require-thread-fence matches, but not atomic operations like compare and exchange. This directive can be used to replace uses of dg-require-thread-fence where an atomic operation is actually used. * testsuite/lib/dg-options.exp (dg-require-atomic-cmpxchg-word): New proc. * testsuite/lib/libstdc++.exp (check_v3_target_atomic_cmpxchg_word): Ditto.
2023-10-06Daily bump.GCC Administrator1-0/+5
2023-10-05libstdc++: [_GLIBCXX_INLINE_VERSION] Add missing symbolsFrançois Dumont1-0/+9
libstdc++-v3/ChangeLog: * config/abi/pre/gnu-versioned-namespace.ver: Add missing symbols for _Float{16,32,64,128,32x,64x,128x}.
2023-10-05Daily bump.GCC Administrator1-0/+18
2023-10-04libstdc++: Correctly call _string_types functionTom Tromey1-1/+1
flake8 points out that the new call to _string_types from StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdExpAnyPrinter.__init__): Qualify call to _string_types.
2023-10-04libstdc++: _versioned_namespace is always non-NoneTom Tromey2-11/+7
Some code in the pretty-printers seems to assume that the _versioned_namespace global might be None (or the empty string). However, doesn't occur, as the variable is never reassigned. libstdc++-v3/ChangeLog: * 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-10-04libstdc++: Define _versioned_namespace in xmethods.pyTom Tromey1-0/+2
flake8 pointed out that is_specialization_of in xmethods.py looks at a global that wasn't added to the file. This patch correct the oversight. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/xmethods.py (_versioned_namespace): Define.
2023-09-30Daily bump.GCC Administrator1-0/+34
2023-09-29libstdc++: Fix handling of surrogate CP in codecvt [PR108976]Dimitrij Mijoski6-449/+1493
This patch fixes the handling of surrogate code points in all standard facets for transcoding Unicode that are based on std::codecvt. Surrogate code points should always be treated as error. On the other hand surrogate code units can only appear in UTF-16 and only when they come in a proper pair. Additionally, it fixes a bug in std::codecvt_utf16::in() when odd number of bytes were given in the range [from, from_end), error was returned always. The last byte in such range does not form a full UTF-16 code unit and we can not make any decisions for error, instead partial should be returned. The testsuite for testing these facets was updated in the following order: 1. All functions that test codecvts that work with UTF-8 were refactored and made more generic so they accept codecvt that works with the char type char8_t. 2. The same functions were updated with new test cases for transcoding errors and now additionally test for surrogates, overlong UTF-8 sequences, code points out of the Unicode range, and more tests for missing leading and trailing code units. 3. New tests were added to test codecvt_utf16 in both of its variants, UTF-16 <-> UTF-32/UCS-4 and UTF-16 <-> UCS-2. libstdc++-v3/ChangeLog: PR libstdc++/108976 * src/c++11/codecvt.cc (read_utf8_code_point): Fix handing of surrogates in UTF-8. (ucs4_out): Fix handling of surrogates in UCS-4 -> UTF-8. (ucs4_in): Fix handling of range with odd number of bytes. (ucs4_out): Fix handling of surrogates in UCS-4 -> UTF-16. (ucs2_out): Fix handling of surrogates in UCS-2 -> UTF-16. (ucs2_in): Fix handling of range with odd number of bytes. (__codecvt_utf16_base<char16_t>::do_in): Likewise. (__codecvt_utf16_base<char32_t>::do_in): Likewise. (__codecvt_utf16_base<wchar_t>::do_in): Likewise. * testsuite/22_locale/codecvt/codecvt_unicode.cc: Renames, add tests for codecvt_utf16<char16_t> and codecvt_utf16<char32_t>. * testsuite/22_locale/codecvt/codecvt_unicode.h: Refactor UTF-8 testing functions for char8_t, add more test cases for errors, add testing functions for codecvt_utf16. * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: Renames, add tests for codecvt_utf16<whchar_t>. * testsuite/22_locale/codecvt/codecvt_utf16/79980.cc (test06): Fix test. * testsuite/22_locale/codecvt/codecvt_unicode_char8_t.cc: New test.
2023-09-29libstdc++: Ensure active union member is correctly setNathaniel Shead3-4/+38
This patch ensures that the union members for std::string and std::variant are always properly set when a change occurs. libstdc++-v3/ChangeLog: * 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. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>