Remove Vector's non-template span constructor#29955
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Jun 19, 2024
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 818639a) Details |
weinig
approved these changes
Jun 19, 2024
818639a to
4d93ec5
Compare
Collaborator
|
EWS run on previous version of this PR (hash 4d93ec5) Details |
4d93ec5 to
713336a
Compare
Collaborator
|
EWS run on previous version of this PR (hash 713336a) Details |
713336a to
182eafe
Compare
Collaborator
|
EWS run on current version of this PR (hash 182eafe) Details |
https://bugs.webkit.org/show_bug.cgi?id=275638 rdar://130130388 Reviewed by Sam Weinig. A std::span can be constructed from a range, so when any compiler is using Microsoft's STL using C++23 and compiles a file that includes IDBKeyData.h, it causes a confusing compiler error because the std::variant implementation checks std::is_trivially_move_constructible on all the types, which tries to instantiate the move constructor of each type, which finds the std::span constructor of Vector that is not a templatized constructor so it is not a substitution error, it is a compiler error. The constructor was only there to help with constructing Vectors from std::arrays, so instead we just add a template constructor that takes a std::array and makes a std::span from it. This covers all the uses except 2 in CryptoKeyOKPCocoa.cpp where we were trying to make a Vector from a uint8[32] so for those cases we just explicitly make a std::span and 2 in {Audio,Video}EncoderGStreamer.cpp where we need to explicitly call the std::span constructor to make an optional vector. I think this is the second to last blocker to us adopting C++23. * Source/WTF/wtf/Vector.h: (WTF::Vector::Vector): * Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp: (WebCore::CryptoKeyOKP::platformGeneratePair): * Source/WebCore/platform/audio/gstreamer/AudioEncoderGStreamer.cpp: (WebCore::GStreamerInternalAudioEncoder::GStreamerInternalAudioEncoder): Canonical link: https://commits.webkit.org/280183@main
182eafe to
f073c57
Compare
Collaborator
|
Committed 280183@main (f073c57): https://commits.webkit.org/280183@main Reviewed commits have been landed. Closing PR #29955 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
f073c57
182eafe
🧪 api-ios🛠 jsc-armv7🧪 jsc-armv7-tests