]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Apply small fix from LWG 3843 to std::expected
authorJonathan Wakely <jwakely@redhat.com>
Wed, 29 Mar 2023 21:43:16 +0000 (22:43 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 20 Apr 2023 11:27:01 +0000 (12:27 +0100)
commit21e5ee580b553a0aa28bae8c7463a9c5a8e7a646
tree00bf7575f1d5248a330453438fd5ee1e9bc2b4a7
parenta5a03ea09ddf09735bc51799743cafc68715104a
libstdc++: Apply small fix from LWG 3843 to std::expected

LWG 3843 adds some type requirements to std::expected::value to ensure
that it can correctly copy the error value if it needs to throw an
exception. We don't need to do anything to enforce that, because it will
already be ill-formed if the type can't be copied. The issue also makes
a small drive-by fix to ensure that a const E& is copied from the
non-const value()& overload, which this change implements.

libstdc++-v3/ChangeLog:

* include/std/expected (expected::value() &): Use const lvalue
for unex member passed to bad_expected_access constructor, as
per LWG 3843.

(cherry picked from commit ce39714a1ce58f2f32e8a44a224061290670db0f)
libstdc++-v3/include/std/expected
This page took 0.055735 seconds and 5 git commands to generate.