-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement LWG-3870 Remove voidify
#3475
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
FYI @strega-nil-ms I pushed changes after you approved - all cleanup-level except for a typo bugfix. |
LWG-3901 is set to Tentatively NAD, while [mem.poly.allocator.mem]/15 says the plain "by uses-allocator construction" instead of Should I restore the support? |
@frederick-vs-ja If I understand the issue correctly, then yes - restoring the support sounds correct. I was about to add this to the final merge batch for 17.7 Preview 1 but I'd rather iterate on this again rather than merge something that has to be corrected later. (Changes will still flow into 17.7 Preview 2 after this.) |
for cv-qualified types.
Reverting commit 1733c9f.
If you actually asked that question - about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If LWG changes polymorphic_allocator
in the future, we can again rip out support for constructing cv-qualified types, I'm not super concerned about it.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for implementing this major LWG issue! 🐈⬛ 🐈⬛ 🐈⬛ |
Fixes #3431.
IIUC
static_cast<void*>(p)
is OK for most of original uses of_Voidify_iter
, since the arguments are generally raw pointers.The original
_Voidify_iter
is still valuable forallocate_shared(_for_overwrite)
due to fancy pointers, so this PR changes its name to_Voidify_unfancy
(withconstexpr
dropped), moves it to<memory>
, and makes it available only when_HAS_CXX20
.The onlyOne remain exception is the use inallocator::construct
(removed in C++20), since N4659 [depr.default.allocator]/6 said that cv-qualification is dropped.Edit:
make_shared(_for_overwrite)
seemly needs cv-removing mechanisms.I have no idea how to add test coverage since this only increases hard errors. On the contrary, we need to drop some invalidated test cases.
The test code added in #3396 is invalidated. I have to implement test coverage in another way.
There seem some breaking and pre-existing inconsistency in
optional
,variant
,expected
,_Variantish
,_Movable_box
, and_Defaultabox
. I'm trying to fix them.I tried to fix them except for
expected
. An LWG issue aboutexpected
is filed,I'll speculatively implement the proposed resolution.That is LWG-3891 but isn't speculatively implemented here.Now this PR also speculative implements proposed resolutions of 1 LWG issue: