Skip to content

<ranges>: Fix regression with ranges::to for ADL-only begin/end #5173

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

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

In #4539, the ranges::for_each call in the resolution of LWG-4016 was "manually inlined" to reduce inclusion dependency. However, the inlining was not always correct, because builtin-in range-for may just stop and fail when a deleted member begin/end function is encountered, while ranges CPOs continue to consider ADL-found begin/end.

As a result, we should still use ranges::begin/ranges::end.

Fixes #5172.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner December 9, 2024 02:41
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Dec 9, 2024
@StephanTLavavej StephanTLavavej self-assigned this Dec 9, 2024
@StephanTLavavej StephanTLavavej removed their assignment Dec 9, 2024
Co-authored-by: Hewill Kang <[email protected]>
@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 53432eb into microsoft:main Dec 13, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this conformance bug in one of the STL's shortest-named functions! 🛠️ 🐞 2️⃣

@frederick-vs-ja frederick-vs-ja deleted the lwg-4016-regression branch December 15, 2024 15:42
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.

<ranges>: ranges::to use range-based for loops in append branches
3 participants