RESOLVED FIXED261485
`Expected` constructor with `unexpect` tag is broken
https://bugs.webkit.org/show_bug.cgi?id=261485
Summary `Expected` constructor with `unexpect` tag is broken
Jean-Yves Avenard [:jya]
Reported 2023-09-12 16:54:35 PDT
Trying to construct an `Expected<int, double>` using `Expected(unexpect, 32.0)` gave me a compilation error "No viable conversion from 'std::experimental::unexpected<double>' to 'value_type' (aka 'int')" The code is wrong https://searchfox.org/wubkat/rev/b38121da42a0483fdb1bc13782f1c7a8059de100/Source/WTF/wtf/Expected.h#448 `template<class... Args> constexpr explicit expected(unexpected_t, Args&&... args) : base(__expected_detail::value_tag, unexpected_type(std::forward<Args>(args)...)) { }` should be: `template<class... Args> constexpr explicit expected(unexpected_t, Args&&... args) : base(__expected_detail::error_tag, unexpected_type(std::forward<Args>(args)...)) { }`
Attachments
Radar WebKit Bug Importer
Comment 1 2023-09-12 18:55:21 PDT
Gerald Squelart
Comment 2 2023-09-12 19:09:53 PDT
EWS
Comment 3 2023-09-12 22:27:25 PDT
Committed 267931@main (95191e8f4045): <https://commits.webkit.org/267931@main> Reviewed commits have been landed. Closing PR #17720 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.