The https://github.com/oneapi-src/oneTBB/pull/833 fix is needed for TBB
headers to avoid an error with GCC 13. The new names_pstl.cc test needs
to check effective target tbb_backend so that it's UNSUPPORTED on
systems without fixed headers.
libstdc++-v3/ChangeLog:
* testsuite/17_intro/names_pstl.cc: Require et tbb_backend.
The non-reserved names 'val' and 'dest' were being used in our headers
but haven't been added to the 17_intro/names.cc test. That's because
they are used by <asm-generic/posix_types.h> and <netinet/tcp.h>
respecitvely on glibc-based systems.
libstdc++-v3/ChangeLog:
* include/bits/fs_ops.h (create_directory): Use reserved name
for parameter.
* include/bits/ranges_algo.h (__contains_subrange_fn):
Likewise.
* 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.
* include/std/tuple (basic_common_reference): Likewise.
* libsupc++/cxxabi_init_exception.h
(__cxa_init_primary_exception): Likewise.
* testsuite/17_intro/names.cc: Add checks.
libstdc++-v3/ChangeLog:
* doc/xml/manual/status_cxx2017.xml: Update an open-std.org link
to www.open-std.org and https.
* doc/html/manual/status.html: Regenerate.
This patch adds -
atomic_flag_test
atomic_flag_test_explicit
Which were missed when commit 491ba6 introduced C++20 atomic flag
test.
libstdc++-v3/ChangeLog:
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.
www.unix.org now redirects to unix.org.
libstdc++-v3/ChangeLog:
* doc/xml/manual/ctype.xml: Change www.unix.org to unix.org.
* doc/html/manual/facets.html: Regenerate.
libstdc++-v3/ChangeLog:
* doc/xml/manual/using.xml: Document newly-freestanding
headers and the effect of the -ffreestanding flag.
* doc/xml/manual/status_cxx2023.xml: Document P1642R11 as
completed.
* doc/xml/manual/configure.xml: Document that hosted installs
respect __STDC_HOSTED__.
* doc/xml/manual/test.xml: Document how to run tests in
freestanding mode.
* doc/html/*: Regenerate.
With the recent change to deprecate std::aligned_storage and
std::aligned_union we need to adjust some tests that now fail with
-std=c++23.
libstdc++-v3/ChangeLog:
* include/std/type_traits: Add diagnostic pragmas around
references to deprecated std::aligned_storage and
std::aligned_union traits.
* testsuite/20_util/aligned_storage/requirements/alias_decl.cc:
Add dg-warning for et c++23.
* testsuite/20_util/aligned_storage/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/aligned_storage/value.cc: Likewise.
* testsuite/20_util/aligned_union/1.cc: Likewise.
* testsuite/20_util/aligned_union/requirements/alias_decl.cc:
Likewise.
Adds deprecated attributes for C++23, and makes use of it for
std::aligned_storage, std::aligned_storage_t, std::aligned_union, and
std::aligned_union_t.
libstdc++-v3/ChangeLog:
* doc/doxygen/user.cfg.in (PREDEFINED): Add new macros.
* include/bits/c++config (_GLIBCXX23_DEPRECATED)
(_GLIBCXX23_DEPRECATED_SUGGEST): New macros.
* include/std/type_traits (aligned_storage, aligned_union)
(aligned_storage_t, aligned_union_t): Deprecate for C++23.
* testsuite/20_util/aligned_storage/deprecated-2b.cc: New test.
* testsuite/20_util/aligned_union/deprecated-2b.cc: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Updates _GLIBCXX20_DEPRECATED to be defined and behave the same as the
versions for other standards (e.g. _GLIBCXX17_DEPRECATED).
libstdc++-v3/ChangeLog:
* doc/doxygen/user.cfg.in (PREDEFINED): Update macros.
* include/bits/c++config (_GLIBCXX20_DEPRECATED): Make
consistent with other 'deprecated' macros.
* include/std/type_traits (is_pod, is_pod_v): Use
_GLIBCXX20_DEPRECATED_SUGGEST instead.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
This enables us to provide symbols for placeholders and numeric limits,
and allows users to mess about with linker flags less.
libstdc++-v3/ChangeLog:
* Makefile.am [!_GLIBCXX_HOSTED]: Enable src/ subdirectory.
* Makefile.in: Regenerate.
* src/Makefile.am [!_GLIBCXX_HOSTED]: Omit compatibility files.
There's no history to be compatible with.
* src/c++11/Makefile.am [!_GLIBCXX_HOSTED]: Omit hosted-only
source files from the build.
* src/c++17/Makefile.am [!_GLIBCXX_HOSTED]: Likewise.
* src/c++20/Makefile.am [!_GLIBCXX_HOSTED]: Likewise.
* src/c++98/Makefile.am [!_GLIBCXX_HOSTED]: Likewise.
* 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.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
This doesn't have any effect yet as we never build anything under
libstdc++-v3/src for freestanding, but that will change in the next
commit.
libstdc++-v3/ChangeLog:
* src/Makefile.am [GLIBCXX_HOSTED] (SUBDIRS): Do not add
filesystem, libbacktrace and experimental.
* src/Makefile.in: Regenerate.
The use of a "naked" int32_t (i.e. without a fitting #include:
stdint.h or cstdint or inttypes.h or an equivalent internal header),
in libstdc++-v3/include/pstl/unseq_backend_simd.h, caused an error for
cris-elf and apparently pru-elf and I guess all "newlib targets".
(Unfortunately, there's a lack of other *-elf targets in recent months
of gcc-testresults archives.)
This does not manifest on e.g. native x86_64-pc-linux-gnu, because
there, a definition is included as an effect of including stdlib.h in
cstdlib (following the trace in native xtreme-header-2_a.ii with
glibc-2.31-13+deb11u5). Maybe better than chasing the right #includes
is to directly use the built-in type, like so:
libstdc++-v3:
PR libstdc++/108672
* include/pstl/unseq_backend_simd.h (__simd_or): Use __INT32_TYPE__
instead of int32_t.
Since resolution of Issue 2593 [1] we can consider that equal allocators
before the propagate-on-move-assignment operations will still be equal
afterward.
So we can extend the optimization of transfering the storage of the move-to
instance to the move-from one that is currently limited to always equal
allocators.
[1] https://cplusplus.github.io/LWG/issue2593
libstdc++-v3/ChangeLog:
* include/bits/basic_string.h (operator=(basic_string&&)): Transfer move-to
storage to the move-from instance when allocators are equal.
* testsuite/21_strings/basic_string/allocator/char/move_assign.cc (test04):
New test case.
This is notably needed because in glibc 2.34, the move of pthread functions
into libc.so happened for Linux only, not GNU/Hurd.
The pthread_self() function can also always be used fine as it is on
GNU/Hurd.
libstdc++-v3/ChangeLog:
* config/os/gnu-linux/os_defines.h [!__linux__]
(_GLIBCXX_NATIVE_THREAD_ID, _GLIBCXX_GTHREAD_USE_WEAK): Do not define.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Because avr-libc <errno.h> defines most error numbers with duplicate
values it's not sufficient to check #ifdef ENOTSUP when deciding which
std::errc constant to use for the filesystem library's __unsupported()
helper. Add a special case for AVR to always use the ENOSYS value.
libstdc++-v3/ChangeLog:
* src/filesystem/ops-common.h [AVR] (__unsupported): Always use
errc::function_not_supported instead of errc::not_supported.
Unlike the new str()&& members in <sstream>, there is no real difficulty
in supporting the new view() members for the old std::string ABI.
Enabling it fixes errors in <chrono> where std::ostringstream::view() is
used by ostream insertion operators for calendar types.
We just need to use [[gnu::always_inline]] on the view() members for the
old ABI, because the library doesn't contain instantiations of them for
the old ABI. Making them always inline avoids needing to add those
instantiations and export them.
libstdc++-v3/ChangeLog:
* include/std/sstream (basic_stringbuf::view): Define for old
std::string ABI.
(basic_istringstream::view, basic_0stringstream::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.
With -fkeep-inline-functions there are linker errors when including
<filesystem>. This happens because there are some filesystem::path
constructors defined inline which call non-exported functions defined in
the library. That's usually not a problem, because those constructors
are only called by code that's also inside the library. But when the
header is compiled with -fkeep-inline-functions those inline functions
are emitted even though they aren't called. That then creates an
undefined reference to the other library internsl. The fix is to just
move the private constructors into the library where they are called.
That way they are never even seen by users, and so not compiled even if
-fkeep-inline-functions is used.
On trunk there is a second problem, which is that the new equality
operators for comparing directory iterators with default_sentinel use
the shared_ptr::operator bool() conversion operator. The shared_ptr
specializations used by directory iterators are explicitly instantiated
in the library, but the bool conversion operators are not exported. This
causes linker errors at -O0 or with -fkeep-inline-functions. That just
requires the conversion operators to be exported.
libstdc++-v3/ChangeLog:
PR libstdc++/108636
* config/abi/pre/gnu.ver (GLIBCXX_3.4.31): Export shared_ptr
conversion operators for directory iterator comparisons with
std::default_sentinel_t.
* 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.
This was approved at the October 2021 plenary.
libstdc++-v3/ChangeLog:
* include/std/variant (variant::operator=): Implement resolution
of LWG 3585.
* testsuite/20_util/variant/lwg3585.cc: New test.
libstdc++-v3/ChangeLog:
* doc/xml/manual/using_exceptions.xml: Update a www.open-std.org
link to https.
* doc/html/manual/using_exceptions.html: Regenerate.
This fixes a build failure that affects avr, but could affect other
targets in theory. The _M_fini function should not try to use ::open or
::fopen if _GLIBCXX_USE_DEV_RANDOM is not defined, because no file can
ever have been opened.
libstdc++-v3/ChangeLog:
* 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.
The abr-libc <errno.h> does not define EOVERFLOW, which means that
std::errc::value_too_large is not defined, and so <charconv> cannot be
compiled. Define value_too_large for avr with a value that does not
clash with any that is defined in <errno.h>. This is a kluge to fix
bootstrap for avr; it can be removed after PR libstdc++/104883 is
resolved.
The avr-libc <errno.h> fails to meet the C and POSIX requirements that
each error macro has a distinct integral value, and is usable in #if
directives. Add a special case for avr to system_error.cc so that only
the valid errors are recognized. Also disable the errno checks in
std::filesystem::remove_all that assume a meaningful value for errno.
On avr-libc <unistd.h> exists but does not define the POSIX functions
needed by std::filesystem, so _GLIBCXX_HAVE_UNISTD_H is not sufficient
to check for basic POSIX APIs. Check !defined __AVR__ as well as
_GLIBCXX_HAVE_UNISTD_H before using those functions. This is a kluge and
we should really have a specific macro that says the required functions
are available.
libstdc++-v3/ChangeLog:
* 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.
The string literal containing the static tzdata.zi information is too
large for some targets, so do not enable it by default for avr-*-* and
msp430-*-*.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ZONEINFO_DIR) [avr-*-*, msp430-*-*]: Set
embed_zoneinfo=no
* configure: Regenerate.
For targets where the ABI mandates structure layout that has
no padding, like cris-elf, this test started failing when
introduced as an add-on to the existing 1.cc, thereby
effectively causing a regression in testsuite results.
Adding an empty structure to S0, corresponds better to the
layout of hh_mm_ss<seconds>.
PR testsuite/108632
* testsuite/std/time/hh_mm_ss/1.cc (size): Add empty
struct at end of S0.
libstdc++-v3/ChangeLog:
* doc/xml/manual/appendix_contributing.xml: Adjust link to
ISO C++ standard at ANSI.
Move link to www.open-std.org to https.
* doc/html/manual/appendix_contributing.html: Regenerate.