aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/expected
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
committerIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
commit3e5f7ca352c26a222bb588741b7c700a3052a372 (patch)
tree283aec084274668fe34c23c49ab2999390ed9778 /libstdc++-v3/include/std/expected
parent2ce0608ca3dca30518bec525c435f7bc4d7f9b70 (diff)
parentb85e79dce149df68b92ef63ca2a40ff1dfa61396 (diff)
downloadgcc-devel/c++-coroutines.zip
gcc-devel/c++-coroutines.tar.gz
gcc-devel/c++-coroutines.tar.bz2
Merge master r12-8312.devel/c++-coroutines
* Merge master r12-8312-gb85e79dce149.
Diffstat (limited to 'libstdc++-v3/include/std/expected')
-rw-r--r--libstdc++-v3/include/std/expected8
1 files changed, 5 insertions, 3 deletions
diff --git a/libstdc++-v3/include/std/expected b/libstdc++-v3/include/std/expected
index 39d07cd..3446d6d 100644
--- a/libstdc++-v3/include/std/expected
+++ b/libstdc++-v3/include/std/expected
@@ -95,7 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class bad_expected_access : public bad_expected_access<void> {
public:
explicit
- bad_expected_access(_Er __e) : _M_val(__e) { }
+ bad_expected_access(_Er __e) : _M_val(std::move(__e)) { }
// XXX const char* what() const noexcept override;
@@ -966,8 +966,8 @@ namespace __expected
}
template<typename _Up, typename _Gr>
- requires is_void_v<_Tp>
- && is_constructible_v<_Er, const _Gr&>
+ requires is_void_v<_Up>
+ && is_constructible_v<_Er, _Gr>
&& (!__cons_from_expected<_Up, _Gr>)
constexpr explicit(!is_convertible_v<_Gr, _Er>)
expected(expected<_Up, _Gr>&& __x)
@@ -1104,6 +1104,7 @@ namespace __expected
std::construct_at(__builtin_addressof(_M_unex),
std::move(__x._M_unex)); // might throw
std::destroy_at(__builtin_addressof(__x._M_unex));
+ _M_has_value = false;
__x._M_has_value = true;
}
}
@@ -1115,6 +1116,7 @@ namespace __expected
std::move(_M_unex)); // might throw
std::destroy_at(__builtin_addressof(_M_unex));
_M_has_value = true;
+ __x._M_has_value = false;
}
else
{