Pass rvalues to _Seek_to in ranges::uninitialized_(copy|move)_n - #2964
Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit intoAug 3, 2022
Merged
Conversation
...as is necessary to properly unwrap-and-rewrap input iterators. Test `ranges::uninitialized_(copy|move)(_n)?` with iterators that require rvalues to unwrap properly which would have caught this bug. Fixes microsoft#2962.
| template <test::ProxyRef IsProxy> | ||
| using test_input = test::range<test::input, int_wrapper, test::Sized::no, test::CanDifference::no, test::Common::no, | ||
| test::CanCompare::yes, IsProxy>; | ||
| test::CanCompare::no, IsProxy>; |
Contributor
Author
There was a problem hiding this comment.
This CanCompare argument directly controls whether the range's iterators can be compared to each other with == and !=, and also happens to determine whether iterators are copyable. We want move-only iterators here since they only rewrap rvalues which would fail to compile without the fix to the product code.
nicole mazzuca (strega-nil-ms)
approved these changes
Jul 28, 2022
Stephan T. Lavavej (StephanTLavavej)
approved these changes
Jul 28, 2022
Michael Schellenberger Costa (miscco)
approved these changes
Jul 29, 2022
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for fixing this bug and enhancing the test coverage! 🐞 😸 🎉 |
nicole mazzuca (strega-nil)
pushed a commit
to strega-nil/stl
that referenced
this pull request
Aug 6, 2022
Igor Zhukov (fsb4000)
pushed a commit
to fsb4000/STL
that referenced
this pull request
Aug 13, 2022
58 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
...as is necessary to properly unwrap-and-rewrap input iterators. Test
ranges::uninitialized_(copy|move)(_n)?with iterators that require rvalues to unwrap properly which would have caught this bug.Fixes #2962.