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

<algorithm>: Fix bogus pointer arithmetic with integer-class #5091

Merged

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Nov 16, 2024

By using ptrdiff_t when the related value is guaranteed to be small enough and/or used in pointer arithmetic. Fixes #2885.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner November 16, 2024 09:24
@CaseyCarter CaseyCarter added bug Something isn't working ranges C++20/23 ranges labels Nov 16, 2024
@StephanTLavavej StephanTLavavej self-assigned this Nov 16, 2024
Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some tweaks that I'll apply.

stl/inc/algorithm Outdated Show resolved Hide resolved
stl/inc/algorithm Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit fec1c8b into microsoft:main Nov 19, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this bogus journey and making the STL most triumphant! 🎸 👨‍🎤 ⏱️

@frederick-vs-ja frederick-vs-ja deleted the stable_sort-integer-class branch November 19, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ranges C++20/23 ranges
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

<algorithm>: ranges::stable_sort missing difference_type casting for pointer arithmetic
3 participants