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

Speculatively implement LWG-3664 #2522

Merged
merged 4 commits into from
Feb 7, 2022
Merged

Conversation

CaseyCarter
Copy link
Member

@CaseyCarter CaseyCarter commented Feb 6, 2022

to fix a regression when calling ranges::distance with array arguments which should decay to pointers.

If you look at LWG-3664 soon, you'll notice this doesn't match the proposed resolution. That original P/R is insufficient (Outlook Code™). Yes, that's right, the fix I suggested for the regression resulting from the fix I made in LWG-3392 is broken. :thonk: I've sent an updated PR with this change to LWG Chair, it will be a few days before the issue gets updated.

to fix a regression when calling `ranges::distance` with array arguments which _should_ decay to pointers.
@CaseyCarter CaseyCarter added bug Something isn't working ranges C++20/23 ranges labels Feb 6, 2022
@CaseyCarter CaseyCarter marked this pull request as ready for review February 6, 2022 08:39
@CaseyCarter CaseyCarter requested a review from a team as a code owner February 6, 2022 08:39
@StephanTLavavej StephanTLavavej self-assigned this Feb 6, 2022
@StephanTLavavej
Copy link
Member

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

stl/inc/xutility Outdated Show resolved Hide resolved
CaseyCarter and others added 3 commits February 6, 2022 10:36
Merge `distance(i, s)` overloads to use `if constexpr` dispatch instead of concept overloading.
@StephanTLavavej
Copy link
Member

I pushed one more commit to directly use [[nodiscard]] and [[nodiscard]] friend in test code, as we don't use the product code macros there.

@CaseyCarter CaseyCarter merged commit bbd5dba into microsoft:main Feb 7, 2022
@CaseyCarter CaseyCarter deleted the lwg3664 branch February 7, 2022 19:54
@CaseyCarter
Copy link
Member Author

CaseyCarter commented Feb 7, 2022

Thanks @timsong-cpp for paying enough attention to catch my bug on a weekend.

For posterity: I bypassed branch policy to merge this with only one maintainer review due to time crunch. We did have some contributor reviews to add confidence.

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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants