RESOLVED FIXED306039
REGRESSION (273395@main): Missing WTF::move() in Expected<T,E>::operator*() && causes inconsistent move semantics
https://bugs.webkit.org/show_bug.cgi?id=306039
Summary REGRESSION (273395@main): Missing WTF::move() in Expected<T,E>::operator*() &...
David Kilzer (:ddkilzer)
Reported 2026-01-22 09:40:20 PST
The non-const rvalue-qualified operator*() method in Expected<T,E> is missing WTF::move(), making it inconsistent with other rvalue-qualified methods in the same class. Current inconsistent behavior: ```cpp // Line 329 - CORRECT (has WTF::move) constexpr const value_type&& operator*() const && LIFETIME_BOUND { return WTF::move(std::get<0>(base::s)); } // Line 330 - INCORRECT (missing WTF::move) constexpr value_type&& operator*() && LIFETIME_BOUND { return std::get<0>(base::s); } // Lines 335-336 - CORRECT (both have WTF::move) constexpr const value_type&& value() const && LIFETIME_BOUND { return WTF::move(std::get<0>(base::s)); } constexpr value_type&& value() && LIFETIME_BOUND { return WTF::move(std::get<0>(base::s)); } // Lines 339-340 - CORRECT (both have WTF::move) constexpr error_type&& error() && LIFETIME_BOUND { return WTF::move(std::get<1>(base::s)); } constexpr const error_type&& error() const && LIFETIME_BOUND { return WTF::move(std::get<1>(base::s)); } ``` The missing WTF::move() in line 330 means operator*() behaves differently from value() when called on rvalue Expected objects, which is unexpected since both should have move semantics when called on temporaries.
Attachments
David Kilzer (:ddkilzer)
Comment 1 2026-01-22 09:40:22 PST
The fix is to add back WTF::move() that was dropped by accident in commit 273395@main: ```cpp constexpr value_type&& operator*() && LIFETIME_BOUND { return WTF::move(std::get<0>(base::s)); } ```
Radar WebKit Bug Importer
Comment 2 2026-01-22 09:40:28 PST
David Kilzer (:ddkilzer)
Comment 3 2026-01-22 09:49:55 PST
EWS
Comment 4 2026-01-22 12:20:07 PST
Committed 306031@main (d4e6d3cf133a): <https://commits.webkit.org/306031@main> Reviewed commits have been landed. Closing PR #57054 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.