You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Fixes#5673 and fixes VSO-2548012 in conjunction with small Build2 changes.
Build2 is doing something extremely complicated and fragile with user-defined character types and regex. When we construct user-defined _Elem from ordinary chars, that triggers assertions in their machinery, even though the resulting homogeneous comparisons between _Elem and _Elem are arguably more cromulent.
This PR slightly backs off from the purity of such comparisons, resulting in code that's somewhat closer to our old way of doing things, but still avoiding the internal _Uelem machinery. Now we directly compare _Elem to char. Build2 has heterogeneous comparison operators that handle this.
It will still be necessary to update Build2 to round-trip their user-defined character type instead of asserting, but that's a less invasive change: build2/build2#478
This makes no difference to the vast, vast majority of users who simply use char or wchar_t.
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well.
I also briefly checked the remaining static_cast's to _Elem in <regex>, but these are either meaningful round-trip casts or they appear in instances where we can't avoid casting to _Elem at some point (at least as long as we don't want to support heterogeneous char_traits or regex_traits implementations, which even Build2 does not provide.)
I've pushed a non-trivial merge with main, reverse-mirroring what I did in MSVC-PR-662263.
This fixes the conflict in GH_000995_regex_custom_char_types with #5671 (which had moved and altered code in the test). Now, signed_wchar_enum and ullong_enum are gaining comparison operators through the same technique, wrapped_character's operators have been adjusted now that it's templated on Elem, and they're all implemented in terms of each other. (I suppose I was ultimately persuaded that it's the simpler thing to do, thanks for the review comment.)
bugSomething isn't workingregexmeow is a substring of homeowner
3 participants
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.
Fixes #5673 and fixes VSO-2548012 in conjunction with small Build2 changes.
Build2 is doing something extremely complicated and fragile with user-defined character types and
regex
. When we construct user-defined_Elem
from ordinarychar
s, that triggers assertions in their machinery, even though the resulting homogeneous comparisons between_Elem
and_Elem
are arguably more cromulent.This PR slightly backs off from the purity of such comparisons, resulting in code that's somewhat closer to our old way of doing things, but still avoiding the internal
_Uelem
machinery. Now we directly compare_Elem
tochar
. Build2 has heterogeneous comparison operators that handle this.It will still be necessary to update Build2 to round-trip their user-defined character type instead of asserting, but that's a less invasive change: build2/build2#478
This makes no difference to the vast, vast majority of users who simply use
char
orwchar_t
.