Fix compatibility with RE2 2023-07-01. - #3134
Open
BillyONeal wants to merge 2 commits into
Open
Conversation
First discovered in microsoft/vcpkg#32595 , Google RE2 no longer provides their own custom StringPiece type, and instead use abseil::string_view (which may end up being std::string_view). google/re2@2d39b70 made StringPiece convertible to std::string and RE2 internally appears to have been changed over to use such conversions. However, if we made the same change RE2 did internally, that would break compatibility with older versions of RE2. There appear to be 2 ways to fix this: 1. Both the old StringPiece and the new string_view have data() and size() members with which we can construct a new std::string without care for which one we got. 2. We can just copy the string_ member we already have. This change does 2 but 1 would be reasonable if the authors wish for that resolution.
7 tasks
Author
|
I just realized that there is a mutable pointer passed out so I'm changing this to #1. |
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.
First discovered in microsoft/vcpkg#32595 , Google RE2 no longer provides their own custom StringPiece type, and instead uses abseil::string_view (which may end up being std::string_view).
google/re2@2d39b70 made StringPiece convertible to std::string and RE2 internally appears to have been changed over to use such conversions.
However, if we made the same change RE2 did internally, that would break compatibility with older versions of RE2. Both the old StringPiece and the new string_view have data() and size() members with which we can construct a new std::string without care for which one we got.