aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/tests/base/dispatch/object.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2026-01-28 12:33:46 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2026-01-29 20:17:40 +0000
commit57f571f7283c72e958f59090f3699bf0111b6bfd (patch)
tree61e5115cdf70b14e807b61fafeb4f996794b27aa /fixincludes/tests/base/dispatch/object.h
parentc906b8f0199d16c93db1df99e789e2fc6bf31680 (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
libstdc++: Make std::expected trivially copy/move assignable (LWG 4026)HEADtrunkmaster
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.
Diffstat (limited to 'fixincludes/tests/base/dispatch/object.h')
0 files changed, 0 insertions, 0 deletions