diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-12-16 16:07:29 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-12-16 20:58:09 +0000 |
commit | 59822c39207c9e8be576e9d6c3370bd85ddaf886 (patch) | |
tree | 5f1c1de4a706e68c52b8906bddc82bb43b92abe0 /libstdc++-v3/include/std/version | |
parent | 64c986b49558a7c356b85bda85195216936c29a3 (diff) | |
download | gcc-59822c39207c9e8be576e9d6c3370bd85ddaf886.zip gcc-59822c39207c9e8be576e9d6c3370bd85ddaf886.tar.gz gcc-59822c39207c9e8be576e9d6c3370bd85ddaf886.tar.bz2 |
libstdc++: Fixes for std::expected
This fixes some bugs in the swap functions for std::expected.
It also disables the noexcept-specifiers for equality operators, because
those are problematic when querying whether a std::expected is equality
comparable. The operator==(const expected<T,E>&, const U&) function is
not constrained, so is viable for comparing expected<T,E> with
expected<void,G>, but then we get an error from the noexcept-specifier.
libstdc++-v3/ChangeLog:
* include/std/expected (expected::_M_swap_val_unex): Guard the
correct object.
(expected::swap): Move is_swappable
requirement from static_assert to constraint.
(swap): Likewise.
(operator==): Remove noexcept-specifier.
* testsuite/20_util/expected/swap.cc: Check swapping of
types without non-throwing move constructor. Check constraints
on swap.
* testsuite/20_util/expected/unexpected.cc: Check constraints on
swap.
* testsuite/20_util/expected/equality.cc: New test.
Diffstat (limited to 'libstdc++-v3/include/std/version')
0 files changed, 0 insertions, 0 deletions