Commit graph

15052 commits

Author SHA1 Message Date
GCC Administrator
9353f6f475 Daily bump. 2024-04-26 00:16:42 +00:00
Jonathan Wakely
8d80e3c5a6
libstdc++: Rename man pages to use '::' instead of '_'
The Doxygen-generated man pages for some new types need to be renamed to
use '::' instead of '_' in the filenames.

libstdc++-v3/ChangeLog:

	* scripts/run_doxygen: Rename man pages for nested types.
2024-04-25 18:38:44 +01:00
Jonathan Wakely
6391cf8bd9
libstdc++: Fix typo in Doxygen comment
libstdc++-v3/ChangeLog:

	* include/std/chrono (tzdb_list): Fix typo in Doxygen comment.
2024-04-25 18:38:43 +01:00
Jonathan Wakely
c9cc1c850c
libstdc++: Fix run_doxygen for Doxygen 1.10 man page format
Doxygen switched from \fC to \fR in its man page output:
https://github.com/doxygen/doxygen/pull/10497

This breaks our script that expects \fC so change the regaulr expression
to work with either style.

libstdc++-v3/ChangeLog:

	* scripts/run_doxygen: Adjust sed pattern to match '\fR' for
	new man output that Doxygen 1.10 generates.
2024-04-25 18:38:43 +01:00
Jonathan Wakely
d5b2c6b32c
libstdc++: Update Doxygen config for new headers
libstdc++-v3/ChangeLog:

	* doc/doxygen/stdheader.cc (init_map): Add missing headers.
	* doc/doxygen/user.cfg.in (EXCLUDE): Exclude generated files for
	std::format and std::text_encoding.
2024-04-25 18:38:43 +01:00
Jonathan Wakely
f3021e6e06
libstdc++: Add comment to #include in <variant>
It's not obvious why <variant> needs <bits/parse_numbers.h> so add a
comment to it.

libstdc++-v3/ChangeLog:

	* include/std/variant: Add comment to #include.
2024-04-25 18:38:43 +01:00
GCC Administrator
8c6ee63bcd Daily bump. 2024-04-23 00:17:49 +00:00
Matthias Kretz
7ef139146a libstdc++: Fix conversion of simd to vector builtin
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	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-04-22 20:56:26 +02:00
Matthias Kretz
e7a3ad29c9 libstdc++: Silence irrelevant warnings in <experimental/simd>
Avoid
-Wnarrowing in C code;
-Wtautological-compare in unconditional static_assert (necessary for
faking a dependency on a template parameter)

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

libstdc++-v3/ChangeLog:

	* 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-04-22 20:56:26 +02:00
Jakub Jelinek
cf5f779105 libstdc++: Workaround kernel-headers on s390x-linux
We see
FAIL: 17_intro/headers/c++1998/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2011/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2014/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2017/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/headers/c++2020/all_attributes.cc   (test for excess errors)
FAIL: 17_intro/names.cc  -std=gnu++17 (test for excess errors)
on s390x-linux.
The first 5 are due to kernel-headers not using uglified attribute names,
where <asm/types.h> contains
__attribute__((packed, aligned(4)))
I've filed a downstream bugreport for this in
https://bugzilla.redhat.com/show_bug.cgi?id=2276084
(not really sure where to report kernel-headers issues upstream), while the
last one is due to <sys/ucontext.h> from glibc containing:
  #ifdef __USE_MISC
  # define __ctx(fld) fld
  #else
  # define __ctx(fld) __ ## fld
  #endif
  ...
  typedef union
    {
      double  __ctx(d);
      float   __ctx(f);
    } fpreg_t;
and g++ predefining -D_GNU_SOURCE which implies define __USE_MISC.

The following patch adds a workaround for this on the libstdc++ testsuite
side.

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

	* testsuite/17_intro/names.cc (d, f): Undefine on s390*-linux*.
	* testsuite/17_intro/headers/c++1998/all_attributes.cc (packed): Don't
	define on s390.
	* testsuite/17_intro/headers/c++2011/all_attributes.cc (packed):
	Likewise.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc (packed):
	Likewise.
	* testsuite/17_intro/headers/c++2017/all_attributes.cc (packed):
	Likewise.
	* testsuite/17_intro/headers/c++2020/all_attributes.cc (packed):
	Likewise.
2024-04-22 18:00:06 +02:00
GCC Administrator
90ded7512e Daily bump. 2024-04-20 00:16:57 +00:00
Jonathan Wakely
d86472a6f0
libstdc++: Simplify constraints on <=> for std::reference_wrapper
Instead of constraining these overloads in terms of synth-three-way we
can just check that the value_type is less-than-comparable, which is
what synth-three-way's constraints check.

The reason that I implemented these with constraints has now been filed
as LWG 4071, so add a comment about that too.

libstdc++-v3/ChangeLog:

	* include/bits/refwrap.h (operator<=>): Simplify constraints.
2024-04-19 21:06:29 +01:00
Jonathan Wakely
eed7fb1b2f
libstdc++: Support link chains in std::chrono::tzdb::locate_zone [PR114770]
Since 2022 the TZif format defined in the zic(8) man page has said that
links can refer to other links, rather than only referring to a zone.
This isn't supported by the C++20 spec, which assumes that the target()
for a chrono::time_zone_link always names a chrono::time_zone, not
another chrono::time_zone_link.

This hasn't been a problem until now, because there are no entries in
the tzdata file that chain links together. However, Debian Sid has
changed the target of the Asia/Chungking link from the Asia/Shanghai
zone to the Asia/Chongqing link, creating a link chain. The libstdc++
code is unable to handle this, so chrono::locate_zone("Asia/Chungking")
will fail with the tzdata.zi file from Debian Sid.

It seems likely that the C++ spec will need a change to allow link
chains, so that the original structure of the IANA database can be fully
represented by chrono::tzdb. The alternative would be for chrono::tzdb
to flatten all chains when loading the data, so that a link's target is
always a zone, but this means throwing away information present in the
tzdata.zi input file.

In anticipation of a change to the spec, this commit adds support for
chained links to libstdc++. When a name is found to be a link, we try to
find its target in the list of zones as before, but now if the target
isn't the name of a zone we don't fail. Instead we look for another link
with that name, and keep doing that until we reach the end of the chain
of links, and then look up the last target as a zone.

This new logic would get stuck in a loop if the tzdata.zi file is buggy
and defines a link chain that contains a cycle, e.g. two links that
refer to each other. To deal with that unlikely case, we use the
tortoise and hare algorithm to detect cycles in link chains, and throw
an exception if we detect a cycle. Cycles in links should never happen,
and it is expected that link chains will be short (if they occur at all)
and so the code is optimized for short chains without cycles. Longer
chains (four or more links) and cycles will do more work, but won't fail
to resolve a chain or get stuck in a loop.

The new test file checks various forms of broken links and cycles.

Also add a new check in the testsuite that every element in the
get_tzdb().zones and get_tzdb().links sequences can be successfully
found using locate_zone.

libstdc++-v3/ChangeLog:

	PR libstdc++/114770
	* src/c++20/tzdb.cc (do_locate_zone): Support links that have
	another link as their target.
	* testsuite/std/time/tzdb/1.cc: Check that all zones and links
	can be found by locate_zone.
	* testsuite/std/time/tzdb/links.cc: New test.
2024-04-19 21:06:28 +01:00
GCC Administrator
85c187b212 Daily bump. 2024-04-19 00:17:11 +00:00
Alexandre Oliva
dcf0bd14cd [libstdc++] [testsuite] disable SRA for compare_exchange_padding
On arm-vx7r2, the uses of as.load() as initializer get SRAed, so the
padding bits in the tests are not what we might expect from full-word
struct copies.

I tried adding a function to perform bitwise copying, but even taking
the as.load() argument by const&, we'd still construct a temporary
with SRAed field-wise copying.  Unable to find another way to ensure
we wouldn't get a temporary, I went for disabling SRA.


for  libstdc++-v3/ChangeLog

	* testsuite/29_atomics/atomic/compare_exchange_padding.cc:
	Disable SRA.
2024-04-18 08:03:56 -03:00
Alexandre Oliva
5b178179e8 [libstdc++] [testsuite] xfail double-prec from_chars for float128_t
Tests 20_util/from_chars/4.cc and 20_util/to_chars/long_double.cc were
adjusted about a year ago to skip long double on some targets, because
the fastfloat library was limited to 64-bit doubles.

The same problem comes up in similar float128_t tests on
aarch64-vxworks.  This patch adjusts them similarly.

Unlike the earlier tests, that got similar treatment for
x86_64-vxworks, these haven't failed there.


for  libstdc++-v3/ChangeLog

	* testsuite/20_util/from_chars/8.cc: Skip float128_t testing
	on aarch64-vxworks.
	* testsuite/20_util/to_chars/float128_c++23.cc: Xfail run on
	aarch64-vxworks.
2024-04-18 08:00:56 -03:00
Alexandre Oliva
da3504ae4d [libstdc++] define zoneinfo_dir_override on vxworks
VxWorks fails to load kernel-mode modules with weak undefined symbols.
In RTP mode modules, that undergo final linking, weak undefined
symbols are not a problem.

This patch adds kernel-mode VxWorks multilibs to the set of targets
that don't support weak undefined symbols without special flags, in
which tzdb's zoneinfo_dir_override is given a weak definition.


for  libstdc++-v3/ChangeLog

	* src/c++20/tzdb.cc (__gnu_cxx::zoneinfo_dir_override): Define
	on VxWorks non-RTP.
2024-04-18 08:00:52 -03:00
GCC Administrator
69576bc01c Daily bump. 2024-04-18 00:17:43 +00:00
Jonathan Wakely
7c2a9dbcc2
libstdc++: Implement "Printing blank lines with println" for C++23
This was recently approved for C++26 at the Tokyo meeting. As suggested
by Stephan T. Lavavej, I'm defining it as an extension for C++23 mode
(when std::print and std::prinln were first added) rather than as a new
C++26 feature. Both MSVC and libc++ have agreed to do this too.

libstdc++-v3/ChangeLog:

	* include/std/ostream (println(ostream&)): Define new overload.
	* include/std/print (println(FILE*), println()): Likewise.
	* testsuite/27_io/basic_ostream/print/2.cc: New test.
	* testsuite/27_io/print/1.cc: Remove unused header.
	* testsuite/27_io/print/3.cc: New test.
2024-04-17 17:33:10 +01:00
Matthias Kretz
3cfe94ad28 libstdc++: Add include guard to simd-internal header
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	* include/experimental/bits/numeric_traits.h: Add include guard.
2024-04-17 10:33:56 +02:00
Matthias Kretz
0fc7f3c6ad libstdc++: Avoid ill-formed types on ARM
This resolves failing tests in check-simd.

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

libstdc++-v3/ChangeLog:

	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-04-17 10:33:56 +02:00
GCC Administrator
9c7cf5d71f Daily bump. 2024-04-17 00:18:45 +00:00
Jonathan Wakely
443748259d
libstdc++: Fix "extact" typos in comments
libstdc++-v3/ChangeLog:

	* config/locale/dragonfly/numeric_members.cc: Fix typos in
	comments.
	* config/locale/gnu/numeric_members.cc: Likewise.
2024-04-16 16:46:15 +01:00
GCC Administrator
e1d4c8e44a Daily bump. 2024-04-16 00:18:06 +00:00
Jonathan Wakely
b6239715c1
libstdc++: Update libstdc++.so versioning history for 14.1.0 release
We can replace "GCC <next>" with "GCC 14.1.0" now that we're nearing the
release.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/abi.xml: Replace "<next>" with "14.1.0".
	* doc/html/manual/abi.html: Regenerate.
2024-04-15 19:28:42 +01:00
Jonathan Wakely
0d58450659
libstdc++: Add std::reference_wrapper comparison operators for C++26
This C++26 change was just approved in Tokyo, in P2944R3. It adds
operator== and operator<=> overloads to std::reference_wrapper.

The operator<=> overloads in the paper cause compilation errors for any
type without <=> so they're implemented here with deduced return types
and constrained by a requires clause.

libstdc++-v3/ChangeLog:

	* include/bits/refwrap.h (reference_wrapper): Add comparison
	operators as proposed by P2944R3.
	* include/bits/version.def (reference_wrapper): Define.
	* include/bits/version.h: Regenerate.
	* include/std/functional: Enable feature test macro.
	* testsuite/20_util/reference_wrapper/compare.cc: New test.
2024-04-15 19:26:09 +01:00
Jonathan Wakely
2a0c083558
libstdc++: Heterogeneous std::pair comparisons [PR113386]
I'm only treating this as a DR for C++20 for now, because it's less work
and only requires changes to operator== and operator<=>. To do this for
older standards would require changes to the six relational operators
used pre-C++20.

libstdc++-v3/ChangeLog:

	PR libstdc++/113386
	* include/bits/stl_pair.h (operator==, operator<=>): Support
	heterogeneous comparisons, as per LWG 3865.
	* testsuite/20_util/pair/comparison_operators/lwg3865.cc: New
	test.
2024-04-15 19:26:09 +01:00
Jonathan Wakely
2d694414ad
libstdc++: Fix infinite loop in std::istream::ignore(n, delim) [PR93672]
A negative delim value passed to std::istream::ignore can never match
any character in the stream, because the comparison is done using
traits_type::eq_int_type(sb->sgetc(), delim) and sgetc() never returns
negative values (except at EOF). The optimized version of ignore for the
std::istream specialization uses traits_type::find to locate the delim
character in the streambuf, which _can_ match a negative delim on
platforms where char is signed, but then we do another comparison using
eq_int_type which fails. The code then keeps looping forever, with
traits_type::find locating the character and traits_type::eq_int_type
saying it's not a match, so traits_type::find is used again and finds
the same character again.

A possible fix would be to check with eq_int_type after a successful
find, to see whether we really have a match. However, that would be
suboptimal since we know that a negative delimiter will never match
using eq_int_type. So a better fix is to adjust the check at the top of
the function that handles delim==eof(), so that we treat all negative
delim values as equivalent to EOF. That way we don't bother using find
to search for something that will never match with eq_int_type.

The version of ignore in the primary template doesn't need a change,
because it doesn't use traits_type::find, instead characters are
extracted one-by-one and always matched using eq_int_type. That avoids
the inconsistency between find and eq_int_type. The specialization for
std::wistream does use traits_type::find, but traits_type::to_int_type
is equivalent to an implicit conversion from wchar_t to wint_t, so
passing a wchar_t directly to ignore without using to_int_type works.

libstdc++-v3/ChangeLog:

	PR libstdc++/93672
	* src/c++98/istream.cc (istream::ignore(streamsize, int_type)):
	Treat all negative delimiter values as eof().
	* testsuite/27_io/basic_istream/ignore/char/93672.cc: New test.
	* testsuite/27_io/basic_istream/ignore/wchar_t/93672.cc: New
	test.
2024-04-15 19:26:09 +01:00
Andreas Schwab
52972ab5c7 libstdc++: Update baseline symbols for riscv64-linux
* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.
2024-04-15 17:30:46 +02:00
GCC Administrator
3319d1a4aa Daily bump. 2024-04-14 00:16:53 +00:00
H.J. Lu
5ec5791105 libstdc++: Update some baseline_symbols.txt (x32)
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt:
	Updated.
2024-04-13 05:40:20 -07:00
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