WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
275265
Alias WTF::Expected against std::expected
https://bugs.webkit.org/show_bug.cgi?id=275265
Summary
Alias WTF::Expected against std::expected
Abrar Rahman Protyasha
Reported
2024-06-07 12:27:05 PDT
As a first step towards replacing `WTF::Expected` altogether.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-06-07 12:27:13 PDT
<
rdar://problem/129411820
>
Abrar Rahman Protyasha
Comment 2
2024-06-07 12:32:38 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/29633
Abrar Rahman Protyasha
Comment 3
2024-06-07 15:11:05 PDT
This is blocked by the fact that most of our types do not have non-throwing move constructors (or, they're not marked as such). If either the result or the error type of `std::expected<Result, Error>` does not satisfy `std::is_nothrow_move_constructible_v`, then the copy assignment operator of that `std::expected` specialization is deleted.
Abrar Rahman Protyasha
Comment 4
2024-06-07 15:13:02 PDT
Here's a representative error message: ``` In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:8: /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp:138:21: error: object of type 'ExceptionOr<Ref<Database>>' cannot be assigned because its copy assignment operator is implicitly deleted 138 | backend = tryToOpenDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, RetryOpenDatabase); In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:1: In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp:27: In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.h:31: In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/dom/EventTarget.h:36: /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/dom/ExceptionOr.h:51:37: note: copy assignment operator of 'ExceptionOr<WTF::Ref<WebCore::Database>>' is implicitly deleted because field 'm_value' has a deleted copy assignment operator 51 | Expected<ReturnType, Exception> m_value; In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource86.cpp:1: In file included from /Users/aprotyas/dev/safari/OpenSource/Source/WebCore/WebCorePrefix.h:165: In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/HashMap.h:24: In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/Forward.h:24: In file included from /Users/aprotyas/dev/safari/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/Expected.h:30: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.Internal.sdk/usr/include/c++/v1/expected:44: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.Internal.sdk/usr/include/c++/v1/__expected/expected.h:628:45: note: 'operator=' has been explicitly marked deleted here 628 | _LIBCPP_HIDE_FROM_ABI constexpr expected& operator=(const expected&) = delete; ```
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