Skip to content

: Remove std::allocator full specialization - #2726

Merged
Stephan T. Lavavej (StephanTLavavej) merged 27 commits into
microsoft:mainfrom
frederick-vs-ja:remove-allocator-void
May 24, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 27 commits into
microsoft:mainfrom
frederick-vs-ja:remove-allocator-void

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

The removal of std::allocator full specialization is observable via SFINAE techniques. As of C++20, using std::allocator::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 full specialization according to N4659. It seems that MSVC STL applied LWG-2103 and LWG-2108 (WG21-N4258) to std::allocator full specialization, but these member types haven't gone into std::allocator in C++17, see N4659 [depr.default.allocator].

Works towards WG21-P0619.

Fixes #527.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner May 17, 2022 06:46
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the bug Something isn't working label May 18, 2022
Comment thread tests/std/tests/GH_000527_remove_allocator_void/test.compile.pass.cpp Outdated
Comment thread stl/inc/xmemory Outdated
Comment thread stl/inc/xmemory Outdated
Comment thread stl/inc/xmemory
Comment thread stl/inc/yvals_core.h Outdated
Comment thread stl/inc/yvals_core.h Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks! I pushed a couple of style changes.

constexpr bool has_cxx20 = false;
#endif

STATIC_ASSERT(has_cxx20 == has_member_size_type>);

@CaseyCarter Casey Carter (CaseyCarter) May 20, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Copy link
Copy Markdown
Member

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

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 4761b6d into microsoft:main May 24, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

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

@frederick-vs-ja
A. Jiang (frederick-vs-ja) deleted the remove-allocator-void branch May 24, 2022 01:22
Igor Zhukov (fsb4000) pushed a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
…soft#2726)

Co-authored-by: Casey Carter 
Co-authored-by: Stephan T. Lavavej 
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.

: We should implement C++20's removal of allocator

3 participants