[libcxx-commits] [PATCH] D119159: [libc++] Make shared_ptr move unique_ptr's deleter

Asher Mancinelli via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 9 15:41:46 PST 2022


ashermancinelli marked 3 inline comments as done.
ashermancinelli added inline comments.


================
Comment at: libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp:235
+    { // LWG 3548
+#if TEST_STD_VER > 3
+      {
----------------
ashermancinelli wrote:
> Quuxplusone wrote:
> > Although I'm not convinced we need anything special for C++03 here, actually. Clang //does// support rvalue references in its non-pedantic C++03 mode, which is all we support; so I'd be surprised if anything behaved differently in C++03 mode.  This seems to be an at-least-moderately-deep rabbit hole; see e.g. https://github.com/llvm/llvm-project/blob/main/libcxx/include/__memory/shared_ptr.h#L477-L481 (additional copy instead of move) and https://github.com/llvm/llvm-project/blob/main/libcxx/include/__memory/shared_ptr.h#L237 (additional move instead of nothing). @ashermancinelli, would you //like// to explore this rabbit hole? If not, I'll do it.
> > 
> > Re styling `TEST_STD_VER` checks: `git grep` is your friend.
> > ```
> > git grep -h 'TEST_STD_VER >' ../libcxx | sort | uniq -c | sort -n
> > ```
> I'd love to take a day or so to look into this rabbit hole, though you would likely find it first, and I won't complain if you do :)
It seems like the copy constructor isn't needed in C++03 as you observed (after going through `compressed_pair` and friends), and the link step succeeds after I remove the member function declarations. Buildkite will determine if I counted my eggs too early :)




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119159/new/

https://reviews.llvm.org/D119159



More information about the libcxx-commits mailing list