Skip to content

Fix LWG-3891 - #38

Open
ComixHe wants to merge 3 commits into
zeus-cpp:mainfrom
ComixHe:main
Open

ComixHe wants to merge 3 commits into
zeus-cpp:mainfrom
ComixHe:main

Conversation

@ComixHe

@ComixHe ComixHe commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

expected<cv T, E> must store remove_cv_t<T>.

Since LWG-3870, std::construct_at rejects a cv pointer, so swap(), emplace() and the value-rebuilding assignment paths failed to compile for cv T.

By the way, it looks like some tests are failing due to LWG-3891. I didn't make any changes to that part of the code in this pr. If you have any ideas, feel free to leave a comment below.

LWG-3891: store remove_cv_t<T> in the union and construct/destroy that
subobject as cv-unqualified. After LWG-3870, std::construct_at cannot
construct through a cv T*, so expected<cv T, E> failed to compile for
every operation that rebuilds the stored value - swap() and the
assignment paths, e.g. expected<volatile int, E>.

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant