This is an archive of the discontinued LLVM Phabricator instance.

[libc++][P0784] Added construct_at and marked destroy_at/destroy/destroy_n constexpr.
AbandonedPublic

Authored by ldionne on Oct 17 2019, 1:25 PM.

Details

Reviewers
EricWF
mclow.lists
mpark
Group Reviewers
Restricted Project

Event Timeline

mpark created this revision.Oct 17 2019, 1:25 PM
ldionne accepted this revision.Nov 4 2019, 5:59 AM
This revision is now accepted and ready to land.Nov 4 2019, 5:59 AM
ldionne requested changes to this revision.Nov 5 2019, 5:44 AM
ldionne added inline comments.
libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
33

Can you add a test trying to call construct_at on a pointer-to-const? Apparently, the intent is that construct_at can be called on a pointer-to-const pointing to a location of memory that hasn't been initialized yet.

The idea is that const only applies to objects that whose lifetime has begun, so the pointer-to-const doesn't point to a const object yet (well, not until you've in-place-newed it).

This revision now requires changes to proceed.Nov 5 2019, 5:44 AM
mpark updated this revision to Diff 228454.Nov 8 2019, 7:22 AM

Updated to be compatible with compilers with partial constexpr dynamic allocation support.

mpark updated this revision to Diff 228455.Nov 8 2019, 7:23 AM

Added the test for construct_at onto a pointer to const.

mpark marked an inline comment as done.Nov 8 2019, 7:23 AM
mpark updated this revision to Diff 228457.Nov 8 2019, 7:27 AM

Fixed the new test.

Harbormaster completed remote builds in B40691: Diff 228457.
mpark updated this revision to Diff 228859.Nov 12 2019, 4:22 AM

Rebased.

mpark updated this revision to Diff 228977.EditedNov 12 2019, 3:37 PM

Rebased.

mpark updated this revision to Diff 229009.Nov 12 2019, 10:40 PM

Rebased.

ldionne requested changes to this revision.Nov 13 2019, 8:13 AM
ldionne added inline comments.
libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
24

Those can be constexpr unconditionally.

libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp
25

Same, constexpr unconditionally.

libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp
54

Jeez, what a pain. Should we consider supporting construct_at in C++17 as an extension?

This revision now requires changes to proceed.Nov 13 2019, 8:13 AM
ldionne commandeered this revision.Sep 22 2020, 5:54 AM
ldionne edited reviewers, added: mpark; removed: ldionne.

This is superseded by https://reviews.llvm.org/D68364.

This revision now requires review to proceed.Sep 22 2020, 5:54 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptSep 22 2020, 5:54 AM
Herald added a subscriber: jkorous. · View Herald Transcript
ldionne abandoned this revision.Sep 22 2020, 5:54 AM