Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sub_match <=> basic_string with custom traits/allocators #4253

Conversation

StephanTLavavej
Copy link
Member

Found by std/re/re.submatch/re.submatch.op/compare.pass.cpp in the upcoming libcxx update.

This follows WG21-N4964 [re.submatch.op]/5:

template<class BiIter, class ST, class SA>
  auto operator<=>(
      const sub_match<BiIter>& lhs,
      const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);

Returns:

static_cast<SM-CAT(BiIter)>(lhs.compare(
    typename sub_match<BiIter>::string_type(rhs.data(), rhs.size()))
      <=> 0
    )

without constructing a temporary. Our equality operators are already correct.

Found by: std/re/re.submatch/re.submatch.op/compare.pass.cpp

Follow N4964 [re.submatch.op]/5 without constructing a temporary. Our equality operators are already correct.
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Dec 10, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner December 10, 2023 07:44
@StephanTLavavej StephanTLavavej self-assigned this Dec 14, 2023
@StephanTLavavej
Copy link
Member Author

StephanTLavavej commented Dec 14, 2023

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit c293fe7 into microsoft:main Dec 14, 2023
37 checks passed
@StephanTLavavej StephanTLavavej deleted the sub_match-spaceship-basic_string branch December 14, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants