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

<vector>: Cast to the correct base type in vector<bool, Alloc>::_Orphan_range_unlocked #4276

Merged

Conversation

frederick-vs-ja
Copy link
Contributor

I've confirmed that @StephanTLavavej's analysis for the related test failure was correct.

Possible STL bug, _Vb_reference derives from _Vb_iter_base and is adopted by the container, but _Orphan_range_unlocked assumes every child is a const_iterator.

This PR exposes _Mybase for the convenience of casting, and removes some unnecessary _Difference_type member type alias as driven-by changes. (It seems better to me to use difference_type whenever it's available.)

Unblocks one libcxx test:

  • std/containers/sequences/vector.bool/emplace_back.pass.cpp

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner December 17, 2023 17:39
@github-actions github-actions bot added this to Initial Review in Code Reviews Dec 17, 2023
@StephanTLavavej StephanTLavavej self-assigned this Dec 18, 2023
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Dec 18, 2023
@CaseyCarter CaseyCarter moved this from Initial Review to Final Review in Code Reviews Jan 10, 2024
@StephanTLavavej StephanTLavavej removed their assignment Jan 10, 2024
@StephanTLavavej StephanTLavavej moved this from Final Review to Ready To Merge in Code Reviews Jan 10, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jan 11, 2024
@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 1444b44 into microsoft:main Jan 11, 2024
35 checks passed
Code Reviews automation moved this from Ready To Merge to Done Jan 11, 2024
@StephanTLavavej
Copy link
Member

Thanks for confirming my initial investigation and figuring out how to fix this libcxx failure! 📉 😻 🛠️

@frederick-vs-ja frederick-vs-ja deleted the cast-to-vb-iter-base branch January 11, 2024 23:19
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
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants