Jonathan Wakely 57f571f728 libstdc++: Make std::expected trivially copy/move assignable (LWG 4026)
This is the subject of two NB comments on C++26 which seem likely to be
approved. We're allowed to make this change as QoI anyway, even if it
isn't approved for the standard, and it should apply to C++23 as well to
avoid ABI changes between C++23 and C++26.

As shown in the updates to the test, defaulted special members can have
noexcept(false) even if they would be noexcept(true) by default. The new
defaulted operator= overloads added by this commit have conditional
noexcept-specifiers that match the conditions of the non-trivial
assignments, propagating any noexcept(false) on trivial special members
of the T and E types. We could strengthen the noexcept for the trivial
operators, but propagating the conditions from the underlying types is
probably what users expect, if they've bothered to put noexcept(false)
on their defaulted special members.

libstdc++-v3/ChangeLog:

	* include/std/expected (__expected::__trivially_replaceable)
	(__expected::__usable_for_assign)
	(__expected::__usable_for_trivial_assign)
	(__expected::__can_reassign_type): New concepts.
	(expected::operator=): Adjust constraints
	on existing overloads and add defaulted overload.
	(expected<cv void, E>::operator=): Likewise.
	* testsuite/20_util/expected/requirements.cc: Check for trivial
	and nothrow properties of assignments.
2026-01-29 20:17:40 +00:00
2026-01-21 00:16:32 +00:00
2026-01-20 00:16:30 +00:00
2026-01-16 00:16:30 +00:00
2026-01-16 00:16:30 +00:00
2026-01-25 00:16:27 +00:00
2026-01-25 00:16:27 +00:00
2026-01-18 00:16:31 +00:00
2026-01-14 00:16:30 +00:00
2026-01-21 00:16:32 +00:00
2026-01-13 00:16:32 +00:00
2026-01-27 00:16:29 +00:00
2026-01-27 00:16:29 +00:00
2026-01-23 00:16:27 +00:00
2026-01-19 09:56:51 +01:00
2026-01-19 09:56:51 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.7 GiB
Languages
C++ 30.7%
C 30.1%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.5%