Commit graph

15021 commits

Author SHA1 Message Date
GCC Administrator
d1a21a6f94 Daily bump. 2024-04-12 00:17:05 +00:00
Jakub Jelinek
eec220142b Update GCC 14.1 library versions in docs
When we are already touching this topic, here is a patch like r13-5126
which documents the upcoming release symbol versions in the documentation.

2024-04-11  Jakub Jelinek  <jakub@redhat.com>

	* doc/xml/manual/abi.xml: Add latest library versions.
	* doc/html/manual/abi.html: Regenerate.
2024-04-11 16:52:45 +02:00
Jakub Jelinek
a975d8961d libstdc++: Regenerate trunk baseline_symbols.txt files for Linux
While the previous patch was regeneration from 13.2 release (with hand
edits for arches I don't have libraries for but which are still well
maintained), thius one is regeneration from the trunk (this time for
hand edits everywhere for the PR114692
https://gcc.gnu.org/pipermail/libstdc++/2024-April/058570.html
patch; plus again hand edits for arches I don't have libraries for).

2024-04-11  Jakub Jelinek  <jakub@redhat.com>

	* 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/m68k-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/riscv64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
2024-04-11 16:37:26 +02:00
Jonathan Wakely
1defe743ae
libstdc++: Export std::__basic_file::native_handle as GLIBCXX_3.4.33 [PR114692]
I added this new symbol in the wrong version. GLIBCXX_3.4.32 was
already used for the GCC 13.2.0 release, so the new symbol should have
been in a new GLIBCXX_3.4.33 version.

Additionally, the pattern doesn't need to use [cw] because we only ever
use __basic_file<char>, even for std::basic_filebuf<wchar_t>.

libstdc++-v3/ChangeLog:

	PR libstdc++/114692
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.32): Move new exports for
	__basic_file::native_handle to ...
	(GLIBCXX_3.4.33): ... here. Adjust to not match wchar_t
	specialization, which isn't used.
	* testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.33 and update
	latest version check.
2024-04-11 15:22:33 +01:00
Jakub Jelinek
508b2b9df1 libstdc++: Regenerate baseline_symbols.txt files for Linux
The following patch regenerates the ABI files for 13 branch (I've only changed
the Linux files which were updated in r13-7289, all but m68k, riscv64 and
powerpc64 are from actual Fedora 39 gcc builds, the rest hand edited).
We've added one symbol very early in the 13.2 cycle, but then added 2
further ones very soon afterwards, quite a long time before 13.2 release
and haven't regenerated.  The patch applies cleanly to trunk as well.

2024-04-11  Jakub Jelinek  <jakub@redhat.com>

	* 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/m68k-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/riscv64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
2024-04-11 15:55:53 +02:00
GCC Administrator
0f3e76ee53 Daily bump. 2024-04-11 00:17:54 +00:00
Jonathan Wakely
4decc1062f
libstdc++: Adjust expected locale-dependent date formats in tests
The std/time/year_month_day/io.cc test assumes that %x in the fr_FR
locale is %d/%m/%Y but on FreeBSD it is %d.%m.%Y instead. Make the test
PASS for either format.

Similarly, 27_io/manipulators/extended/get_time/char/2.cc expects that
%a in the de_DE locale is "Di" but on FreeBSD it's "Di." with a trailing
period. Adjust the input string to be "1971 Di." instead of "Di 1971"
and that way if %a doesn't expect the trailing '.' it simply won't
extract it from the stream.

This fixes:
FAIL: std/time/year_month_day/io.cc  -std=gnu++20 execution test
FAIL: 27_io/manipulators/extended/get_time/char/2.cc  -std=gnu++17 execution test

libstdc++-v3/ChangeLog:

	* testsuite/27_io/manipulators/extended/get_time/char/2.cc:
	Adjust input string so that it matches %a with or without a
	trailing period.
	* testsuite/std/time/year_month_day/io.cc: Adjust expected
	format for %x in the fr_FR locale.
2024-04-10 16:14:25 +01:00
Jonathan Wakely
9586d6248e
libstdc++: Handle EMLINK and EFTYPE in std::filesystem::remove_all
Although POSIX requires ELOOP, FreeBSD documents that openat with
O_NOFOLLOW returns EMLINK if the last component of a filename is a
symbolic link.  Check for EMLINK as well as ELOOP, so that the TOCTTOU
mitigation in remove_all works correctly.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 or the
FreeBSD man page for reference.

According to its man page, DragonFlyBSD also uses EMLINK for this error,
and NetBSD uses its own EFTYPE. OpenBSD follows POSIX and uses EMLINK.

This fixes these failures on FreeBSD:
FAIL: 27_io/filesystem/operations/remove_all.cc  -std=gnu++17 execution test
FAIL: experimental/filesystem/operations/remove_all.cc  -std=gnu++17 execution test

libstdc++-v3/ChangeLog:

	* src/c++17/fs_ops.cc (remove_all) [__FreeBSD__ || __DragonFly__]:
	Check for EMLINK as well as ELOOP.
	[__NetBSD__]: Check for EFTYPE as well as ELOOP.
2024-04-10 12:58:28 +01:00
GCC Administrator
0753ae158a Daily bump. 2024-04-10 00:16:50 +00:00
Jonathan Wakely
92b38ec84f
libstdc++: Fix build for targets without FP std::from_chars [PR114633]
If the faster std::from_chars is not supported for floating-point types
then just extract the value from the stream using operator>>.

This fixes a build error for targets where __cpp_lib_to_chars is not
defined.

libstdc++-v3/ChangeLog:

	PR libstdc++/114633
	* include/bits/chrono_io.h (_Parser::operator()) <'S'>: Use
	stream extraction if std::from_chars is not available.
2024-04-10 00:21:41 +01:00
GCC Administrator
45532e3a92 Daily bump. 2024-04-09 00:17:24 +00:00
Jonathan Wakely
feb6a2d356
libstdc++: Use char for _Utf8_view if char8_t isn't available [PR114519]
Instead of just omitting the definition of __unicode::_Utf8_view when
char8_t is disabled, we can make it use char instead.

libstdc++-v3/ChangeLog:

	PR libstdc++/114519
	* include/bits/unicode.h (_Utf8_view) [!__cpp_char8_t]: Define
	using char instead of char8_t.
	* testsuite/ext/unicode/view.cc: Use u8""sv literals to create
	string views, instead of std::u8string_view.
2024-04-08 17:44:18 +01:00
Jonathan Wakely
cd77e15287
libstdc++: Fix tests that fail with -fno-char8_t
Adjust expected errors or skip tests as UNSUPPORTED if -fno-char8_t is
used in the test flags.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/integer_comparisons/equal_neg.cc: Use
	no-opts selector for errors that depend on -fchar8_t.
	* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
	Likewise.
	* testsuite/20_util/integer_comparisons/greater_neg.cc:
	Likewise.
	* testsuite/20_util/integer_comparisons/in_range_neg.cc:
	Likewise.
	* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
	Likewise.
	* testsuite/20_util/integer_comparisons/less_neg.cc: Likewise.
	* testsuite/20_util/integer_comparisons/not_equal_neg.cc:
	Likewise.
	* testsuite/21_strings/basic_string/hash/hash_char8_t.cc: Skip
	if -fno-char8_t is used.
	* testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc:
	Likewise.
	* testsuite/27_io/filesystem/path/factory/u8path-depr.cc: Use
	char for u8 literal if char8_t is not available.
	* testsuite/27_io/headers/iosfwd/synopsis.cc: Check
	__cpp_char8_t.
	* testsuite/29_atomics/atomic_integral/wait_notify.cc: Likewise.
	* testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc:
	Remove check for _GLIBCXX_USE_CHAR8_T.
2024-04-08 17:44:18 +01:00
Jonathan Wakely
87bc20676c
libstdc++: Combine two std::from_chars tests into one
We don't need separate tests for the C++17 and C++20 cases, we can just
have one test that uses __cpp_char8_t to adjust whether it tests char8_t
or not. This means the C++20 one doesn't fail if -fno-char8_t is used.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/from_chars/1_neg.cc: Add char8_t cases,
	using a struct of that name if -fno-char8_t is active.
	* testsuite/20_util/from_chars/1_c++20_neg.cc: Removed.
2024-04-08 17:44:18 +01:00
GCC Administrator
88ce7fbcc7 Daily bump. 2024-04-04 00:16:38 +00:00
Jonathan Wakely
7f65d8267f
libstdc++: Reverse arguments in constraint for std::optional's <=> [PR104606]
This is a workaround for a possible compiler bug that causes constraint
recursion in the operator<=>(const optional<T>&, const U&) overload.

libstdc++-v3/ChangeLog:

	PR libstdc++/104606
	* include/std/optional (operator<=>(const optional<T>&, const U&)):
	Reverse order of three_way_comparable_with template arguments.
	* testsuite/20_util/optional/relops/104606.cc: New test.
2024-04-03 11:45:35 +01:00
GCC Administrator
a1e6798acf Daily bump. 2024-04-03 00:17:29 +00:00
Jonathan Wakely
21aa57e73b libstdc++: Guard uses of char8_t with __cpp_char8_t [PR114519]
libstdc++-v3/ChangeLog:

	PR libstdc++/114519
	* include/bits/unicode.h (_Utf8_view): Guard with check for
	char8_t being enabled.
	(__literal_encoding_is_unicode): Guard use of char8_t with check
	for it being enabled.
	* testsuite/std/format/functions/114519.cc: New test.
2024-04-02 20:55:32 +01:00
Patrick Palka
0e64bbb882 libstdc++: Allow adjacent __maybe_present_t<false, ...> fields to overlap
Currently __maybe_present_t<false, T> maps to the same empty class
type independent of T.  This is suboptimal because it means adjacent
__maybe_present_t<false, ...> members with the [[no_unique_address]]
attribute can't overlap even if the conditionally present types are
different.

This patch turns this empty class type into a template parameterized by
the conditionally present type, so that

  [[no_unique_address]] __maybe_present_t<false, T> _M_a;
  [[no_unique_address]] __maybe_present_t<false, U> _M_b;

now overlap if T and U are different.

This patch goes a step further and also adds an optional integer
discriminator parameter to allow for overlapping when T and U are
the same.

libstdc++-v3/ChangeLog:

	* include/std/ranges (ranges::__detail::_Empty): Rename to ...
	(ranges::__detail::_Absent): ... this.  Turn into a template
	parameterized by the absent type _Tp and discriminator _Disc.
	(ranges::__detail::__maybe_present_t): Add an optional
	discriminator parameter.
	(slide_view::_M_cached_begin): Pass a discriminator argument to
	__maybe_present_t.
	(slide_view::_M_cached_end): Likewise.
	* testsuite/std/ranges/adaptors/sizeof.cc: Verify the size of
	slide_view<V> is 3 instead 4 pointers.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-04-02 13:07:07 -04:00
Jakub Jelinek
94792057ad Fix up duplicated words mostly in comments, part 1
Like in r12-7519-g027e30414492d50feb2854aff38227b14300dc4b, I've done
git grep -v 'long long\|optab optab\|template template\|double double' | grep ' \([a-zA-Z]\+\) \1 '

This is just part of the changes, mostly for non-gcc directories.
I'll try to get to the rest soon.  Obviously, the above command also
finds cases which are correct as is and shouldn't be changed, so one
needs to manually inspect everything.

I'd hope most of it is pretty obvious, but the config/ and libstdc++-v3/
hunks include a tweak in a license wording, though other copies of the
similar license have the wording right.

2024-04-02  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.tpl: Fix duplicated words; returns returns ->
	returns.
config/
	* lcmessage.m4: Fix duplicated words; can can -> can,
	package package -> package.
libdecnumber/
	* decCommon.c (decFinalize): Fix duplicated words in
	comment; the the -> the.
libgcc/
	* unwind-dw2-fde.c (struct fde_accumulator): Fix duplicated
	words in comment; is is -> is.
libgfortran/
	* configure.host: Fix duplicated words; the the -> the.
libgm2/
	* configure.host: Fix duplicated words; the the -> the.
libgomp/
	* libgomp.texi (OpenMP 5.2): Fix duplicated words; with with ->
	with.
	(omp_target_associate_ptr): Fix duplicated words; either either ->
	either.
	(omp_init_allocator): Fix duplicated words; be be -> be.
	(omp_realloc): Fix duplicated words; is is -> is.
	(OMP_ALLOCATOR): Fix duplicated words; other other -> other.
	* priority_queue.h (priority_queue_multi_p): Fix duplicated words;
	to to -> to.
libiberty/
	* regex.c (byte_re_match_2_internal): Fix duplicated words in comment;
	next next -> next.
	* dyn-string.c (dyn_string_init): Fix duplicated words in comment;
	of of -> of.
libitm/
	* beginend.cc (GTM::gtm_thread::begin_transaction): Fix duplicated
	words in comment; not not -> not to.
libobjc/
	* init.c (duplicate_classes): Fix duplicated words in comment; in in
	-> in.
	* sendmsg.c (__objc_prepare_dtable_for_class): Fix duplicated words
	in comment; the the -> the.
	* encoding.c (objc_layout_structure): Likewise.
libstdc++-v3/
	* acinclude.m4: Fix duplicated words; file file -> file can.
	* configure.host: Fix duplicated words; the the -> the.
libvtv/
	* vtv_rts.cc (vtv_fail): Fix duplicated words; to to -> to.
	* vtv_fail.cc (vtv_fail): Likewise.
2024-04-02 13:39:11 +02:00
GCC Administrator
4921bd8cf2 Daily bump. 2024-03-30 00:16:42 +00:00
Arsen Arsenović
f15cea16cc
libstdc++-v3: drop GCC Runtime Library Exception from gen tests
It was mistakenly added to these files.

libstdc++-v3/ChangeLog:

	* testsuite/24_iterators/range_generators/01.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/02.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/copy.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/except.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/subrange.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/synopsis.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/iter_deref_return.cc:
	Drop GCC Runtime Library Exception from the "You should have
	received a copy" paragraph.
2024-03-29 12:50:06 +01:00
GCC Administrator
feafff0494 Daily bump. 2024-03-28 00:17:52 +00:00
Matthias Kretz
a6c630c314 libstdc++: Add masked ++/-- implementation for sizeof < 16
This resolves further failures (-Wreturn-type warnings) and test
failures for where-* tests targeting AVX-512.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	* 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-03-27 15:14:46 +01:00
Matthias Kretz
0ac2c0f068 libstdc++: Fix call signature of builtins from masked ++/--
This resolves failures in the "expensive" where-* test of check-simd
when targeting AVX-512.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	* 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-03-27 15:14:46 +01:00
Srinivas Yadav Singanaboina
9ac3119fec libstdc++: add ARM SVE support to std::experimental::simd
libstdc++-v3/ChangeLog:

	* include/Makefile.am: Add simd_sve.h.
	* include/Makefile.in: Add simd_sve.h.
	* include/experimental/bits/simd.h: Add new SveAbi.
	* include/experimental/bits/simd_builtin.h: Use
	__no_sve_deduce_t to support existing Neon Abi.
	* include/experimental/bits/simd_converter.h: Convert
	sequentially when sve is available.
	* include/experimental/bits/simd_detail.h: Define sve
	specific macro.
	* include/experimental/bits/simd_math.h: Fallback frexp
	to execute sequntially when sve is available, to handle
	fixed_size_simd return type that always uses sve.
	* include/experimental/simd: Include bits/simd_sve.h.
	* testsuite/experimental/simd/tests/bits/main.h: Enable
	testing for sve128, sve256, sve512.
	* include/experimental/bits/simd_sve.h: New file.

Signed-off-by: Srinivas Yadav Singanaboina <vasu.srinivasvasu.14@gmail.com>
2024-03-27 15:14:36 +01:00
GCC Administrator
4b8e7b57d9 Daily bump. 2024-03-27 00:18:06 +00:00
Arsen Arsenović
fb1d50e1f6
libstdc++: fix generator iterator operator* return type
Per the standard, the return type of a generators ranges iterator op*
should be the reference type rather than the yielded type.

The yielded type was used here by mistake.

libstdc++-v3/ChangeLog:

	* include/std/generator (generator::_Iterator::operator*): Fix
	return type.
	* testsuite/24_iterators/range_generators/iter_deref_return.cc:
	New test.
2024-03-26 22:33:48 +01:00
Arsen Arsenović
ac5d63a46d
libstdc++: fix _V badname in <generator>
libstdc++-v3/ChangeLog:

	* include/std/generator: Fix _V badname.
2024-03-26 22:33:47 +01:00
Jonathan Wakely
217e778a31 libstdc++: Replace stacktrace effective target with feature test
Rmove the dejagnu code for checking whether std::stacktrace is supported
and just use the new dg-require-cpp-feature-test directive to check for
__cpp_lib_stacktrace instead.

libstdc++-v3/ChangeLog:

	* testsuite/19_diagnostics/stacktrace/current.cc: Check for
	__cpp_lib_stacktrace instead of check for stacktrace ET.
	* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/hash.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/output.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/synopsis.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/version.cc: Likewise.
	* testsuite/23_containers/vector/debug/assign4_backtrace_neg.cc:
	Likewise.
	* testsuite/lib/libstdc++.exp (check_effective_target_stacktrace):
	Remove.
2024-03-26 11:32:55 +00:00
Jonathan Wakely
4a3a1b6b75 libstdc++: Add dg-require-cpp-feature-test to test feature test macros
This adds a new dejagnu directive which can be used to make a test
depend on a feature test macro such as __cpp_lib_text_encoding. This is
mroe flexible than writing a new dg-require-xxx for each feature.

libstdc++-v3/ChangeLog:

	* testsuite/lib/dg-options.exp (dg-require-cpp-feature-test):
	New proc.
	* testsuite/lib/libstdc++.exp (check_v3_target_cpp_feature_test):
	New proc.
	* testsuite/std/text_encoding/cons.cc: Use new directive to skip
	the test if the __cpp_lib_text_encoding feature test macro is
	not defined.
	* testsuite/std/text_encoding/requirements.cc: Likewise.
2024-03-26 11:32:55 +00:00
GCC Administrator
7e6cdec4d3 Daily bump. 2024-03-26 00:17:13 +00:00
Jonathan Wakely
cf3fc6f414 libstdc++: Fix incorrect macro used in #undef in test
This was a copy & paste error.

libstdc++-v3/ChangeLog:

	* testsuite/std/text_encoding/requirements.cc: #undef the
	correct macro.
2024-03-25 12:13:50 +00:00
GCC Administrator
bb04a11418 Daily bump. 2024-03-24 00:16:50 +00:00
Jonathan Wakely
543585046d libstdc++: Disable std::formatter specializations (LWG 3944)
This was just approved in Tokyo as a DR for C++23. It doesn't affect us
yet, because we don't implement the __cpp_lib_format_ranges features. We
can add the disabled specializations and add a testcase now though.

libstdc++-v3/ChangeLog:

	* include/std/format (formatter): Disable specializations that
	would allow sequences of narrow characters to be formatted as
	wchar_t without conversion, as per LWG 3944.
	* testsuite/std/format/formatter/lwg3944.cc: New test.
2024-03-23 11:07:57 +00:00
Jonathan Wakely
3763fb8970 libstdc++: Add __is_in_place_index_v helper and use it in <variant>
We already have __is_in_place_type_v for in_place_type_t so adding an
equivalent for in_place_index_t allows us avoid a class template
instantiation for the __not_in_place_tag constraint on the most
commonly-used std::variant::variant(T&&) constructor.

For in_place_type_t we also have a __is_in_place_type class template
defined in terms of the variable template, but that isn't actually used
anywhere. I'm not adding an equivalent for the new variable template,
because that wouldn't be used either.

For GCC 15 we should remove the unused __is_in_place_tag and
__is_in_place_type class templates.

libstdc++-v3/ChangeLog:

	* include/bits/utility.h (__is_in_place_index_v): New variable
	template.
	* include/std/variant (__not_in_place_tag): Define in terms of
	variable templates not a class template.
2024-03-23 11:07:57 +00:00
Jonathan Wakely
f4605c53ea libstdc++: Use std::type_identity_t in <string_view> as per LWG 3950 [PR114400]
The difference between __type_identity_t and std::type_identity_t is
observable, as demonstrated in the PR. Nobody in LWG seems to think this
an example we should really care about, but it seems easy and harmless
to change this.

libstdc++-v3/ChangeLog:

	PR libstdc++/114400
	* include/std/string_view (operator==): Use std::type_identity_t
	in C++20 instead of our own __type_identity_t.
2024-03-23 11:07:57 +00:00
GCC Administrator
e8985864a3 Daily bump. 2024-03-23 00:17:26 +00:00
Jonathan Wakely
c2e28df90a libstdc++: Destroy allocators in re-inserted container nodes [PR114401]
The allocator objects in container node handles were not being destroyed
after the node was re-inserted into a container. They are stored in a
union and so need to be explicitly destroyed when the node becomes
empty. The containers were zeroing the node handle's pointer, which
makes it empty, causing the handle's destructor to think there's nothign
to clean up.

Add a new member function to the node handle which destroys the
allocator and zeros the pointer. Change the containers to call that
instead of just changing the pointer manually.

We can also remove the _M_empty member of the union which is not
necessary.

libstdc++-v3/ChangeLog:

	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-03-22 22:39:06 +00:00
Jonathan Wakely
142cc4c223 libstdc++: Constrain std::vector default constructor [PR113841]
This is needed to avoid errors outside the immediate context when
evaluating is_default_constructible_v<vector<T, A>> when A is not
default constructible.

To avoid diagnostic regressions for 23_containers/vector/48101_neg.cc we
need to make the std::allocator<cv T> partial specializations default
constructible, which they probably should have been anyway.

libstdc++-v3/ChangeLog:

	PR libstdc++/113841
	* include/bits/allocator.h (allocator<cv T>): Add default
	constructor to partial specializations for cv-qualified types.
	* include/bits/stl_vector.h (_Vector_impl::_Vector_impl()):
	Constrain so that it's only present if the allocator is default
	constructible.
	* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()):
	Likewise.
	* testsuite/23_containers/vector/cons/113841.cc: New test.
2024-03-22 22:39:06 +00:00
Jonathan Wakely
8539c5610a libstdc++: Use feature test macros in <bits/stl_construct.h>
The preprocessor checks for __cplusplus in <bits/stl_construct.h> should
use the appropriate feature test macros instead of __cplusplus, namely
__glibcxx_raw_memory_algorithms and __cpp_constexpr_dynamic_alloc.

For the latter, we want to check the compiler macro not the library's
__cpp_lib_constexpr_dynamic_alloc, because the latter is not defined for
freestanding but std::construct_at needs to be.

libstdc++-v3/ChangeLog:

	* include/bits/stl_construct.h (destroy_at, construct_at): Guard
	with feature test macros instead of just __cplusplus.
2024-03-22 22:39:05 +00:00
Jonathan Wakely
ff773ac3d9 libstdc++: Reorder feature test macro definitions
Put the C++23 generator and tuple_like ones before the C++26 ones.

libstdc++-v3/ChangeLog:

	* include/bits/version.def (generator, tuple_like): Move earlier
	in the file.
	* include/bits/version.h: Regenerate.
2024-03-22 22:39:05 +00:00
Jonathan Wakely
31ef58b18d libstdc++: Replace std::result_of with __invoke_result_t [PR114394]
Replace std::result_of with std::invoke_result, as specified in the
standard since C++17, to avoid deprecated warnings for std::result_of.

We don't have __invoke_result_t in C++11 mode, so add it as an alias
template for __invoke_result<>::type (which is what std::result_of uses
as its base class, so there's no change in functionality).

This fixes warnings given by Clang 18.

libstdc++-v3/ChangeLog:

	PR libstdc++/114394
	* include/std/functional (bind): Use __invoke_result_t instead
	of result_of::type.
	* include/std/type_traits (__invoke_result_t): New alias
	template.
	* testsuite/20_util/bind/ref_neg.cc: Adjust prune pattern.
2024-03-22 22:37:57 +00:00
GCC Administrator
af37618473 Daily bump. 2024-03-21 00:18:14 +00:00
François Dumont
d2b25083a4 libstdc++: [_GLIBCXX_DEBUG] Define __cpp_lib_null_iterators
_GLIBCXX_DEBUG has now fully N3344 compliant iterator checks, we can define
__cpp_lib_null_iterators macros like the normal mode.

libstdc++-v3/ChangeLog:

	* include/bits/version.def (null_iterators): Remove extra_cond.
	* include/bits/version.h: Regenerate.
2024-03-20 18:59:49 +01:00
GCC Administrator
cc606a916d Daily bump. 2024-03-20 00:18:09 +00:00
Jonathan Wakely
07e03761a7 libstdc++: Fix infinite loop in std::binomial_distribution [PR114359]
The multiplication (4 * _M_t * __1p) can wraparound to zero if _M_t is
unsigned and 4 * _M_t wraps to zero. The third operand has type double,
so do the second multiplication first, so that we aren't multiplying
integers.

libstdc++-v3/ChangeLog:

	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-03-19 15:59:44 +00:00
Jonathan Wakely
c608b57f77 libstdc++: Suppress deprecation messages from <tbb/task.h> [PR101228]
libstdc++-v3/ChangeLog:

	PR libstdc++/101228
	* include/pstl/parallel_backend_tbb.h (TBB_SUPPRESS_DEPRECATED_MESSAGES):
	Define before including <tbb/task.h> then undef afterwards.
2024-03-19 15:59:44 +00:00
Jonathan Wakely
90788dd722 libstdc++: Regenerate <bits/version.h> in maintainer mode
This is a generated header but regenerating it requires the manual step
of running 'make -C include update-version' in the libstdc++ build dir.
Make it regenerate automatically when --enable-maintainer-mode is used.

libstdc++-v3/ChangeLog:

	* include/Makefile.am [MAINTAINER_MODE]: Add target to
	automatically update <bits/version.h>.
	* include/Makefile.in: Regenerate.

gcc/ChangeLog:

	* doc/install.texi (Prerequisites): Document use of autogen for
	libstdc++.
2024-03-19 15:20:07 +00:00
Jonathan Wakely
d1b8c2237d libstdc++: Update docs on build process and generated files
There are several more sub-directories below 'src' now, with lots more
conveience libraries. Document them all as of GCC 14.

Also document how to regenerate the generated headers under include/bits
and how to update the tzdata.zi file.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/build_hacking.xml: Document generated files.
	Update list of convenience libraries and sub-directories under
	the src directory.
	* doc/html/*: Regenerate.
2024-03-19 15:20:07 +00:00