WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
306043
Adopt LIFETIME_BOUND for WTF::Expected
https://bugs.webkit.org/show_bug.cgi?id=306043
Summary
Adopt LIFETIME_BOUND for WTF::Expected
David Kilzer (:ddkilzer)
Reported
2026-01-22 10:16:35 PST
Add LIFETIME_BOUND attribute to operator->, operator*, value(), and error() methods in Expected<T,E> template class to prevent unsafe uses that could lead to dangling references. The following methods will be updated to include LIFETIME_BOUND: ```cpp // Pointer access methods constexpr const value_type* operator->() const LIFETIME_BOUND; value_type* operator->() LIFETIME_BOUND; // Reference access methods constexpr const value_type& operator*() const & LIFETIME_BOUND; value_type& operator*() & LIFETIME_BOUND; constexpr const value_type&& operator*() const && LIFETIME_BOUND; constexpr value_type&& operator*() && LIFETIME_BOUND; // Value access methods constexpr const value_type& value() const & LIFETIME_BOUND; constexpr value_type& value() & LIFETIME_BOUND; constexpr const value_type&& value() const && LIFETIME_BOUND; constexpr value_type&& value() && LIFETIME_BOUND; // Error access methods constexpr const error_type& error() const & LIFETIME_BOUND; error_type& error() & LIFETIME_BOUND; constexpr error_type&& error() && LIFETIME_BOUND; constexpr const error_type&& error() const && LIFETIME_BOUND; ```
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-01-22 12:56:25 PST
<
rdar://problem/168699050
>
David Kilzer (:ddkilzer)
Comment 2
2026-01-22 13:01:53 PST
Pull request:
https://github.com/WebKit/WebKit/pull/57067
EWS
Comment 3
2026-01-23 11:46:42 PST
Committed
306108@main
(fb63b305a9c2): <
https://commits.webkit.org/306108@main
> Reviewed commits have been landed. Closing PR #57067 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug