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

<xmemory>: Remove std::allocator<void> full specialization #2726

Merged
merged 27 commits into from
May 24, 2022

Conversation

frederick-vs-ja
Copy link
Contributor

The removal of std::allocator<void> full specialization is observable via SFINAE techniques. As of C++20, using std::allocator<void>::allocate is no longer a substitution failure, but a hard error. This PR tests such changes.

This PR also removes propagate_on_container_move_assignment and is_always_equal from std::allocator<void> full specialization according to N4659. It seems that MSVC STL applied LWG-2103 and LWG-2108 (WG21-N4258) to std::allocator<void> full specialization, but these member types haven't gone into std::allocator<void> in C++17, see N4659 [depr.default.allocator].

Works towards WG21-P0619.

Fixes #527.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner May 17, 2022 06:46
@StephanTLavavej StephanTLavavej added the bug Something isn't working label May 18, 2022
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this May 18, 2022
@StephanTLavavej
Copy link
Member

Thanks! I pushed a couple of style changes.

@StephanTLavavej StephanTLavavej removed their assignment May 20, 2022
#endif

STATIC_ASSERT(has_cxx20 == has_member_size_type<allocator<void>>);
Copy link
Member

@CaseyCarter CaseyCarter May 20, 2022

Choose a reason for hiding this comment

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

Pure style, and totally not worth resetting testing if we change nothing else: I would have written these as [Actual value] == [Expected value], which I think is more consistent with our test conventions.

Copy link
Member

Choose a reason for hiding this comment

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

That's my preferred style too - but I did it this way so that they would line up, and make the pattern obvious.

@StephanTLavavej StephanTLavavej self-assigned this May 21, 2022
@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 4761b6d into microsoft:main May 24, 2022
@StephanTLavavej
Copy link
Member

Thanks for fixing this C++20 conformance issue! ✅ 😸 🚀

@frederick-vs-ja frederick-vs-ja deleted the remove-allocator-void branch May 24, 2022 01:22
fsb4000 pushed a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
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
None yet
Development

Successfully merging this pull request may close these issues.

<xmemory>: We should implement C++20's removal of allocator<void>
3 participants