[libcxx-commits] [PATCH] D135548: [libc++] Implement c++20 shared_ptr rvalue overloads.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 2 07:32:40 PST 2023


philnik accepted this revision as: philnik.
philnik added a comment.

Please mention the LWG issue you are implementing in the title. Other than that and inline comments this LGTM. Leaving final approval to @Mordante, since he had comments.



================
Comment at: libcxx/include/__memory/shared_ptr.h:596
+// We don't backport because it is an evolutionary change.
+#if _LIBCPP_STD_VER > 20
+    template <class _Yp>
----------------
The LWG issue is against C++20. Same for the other changes.


================
Comment at: libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cast/const_pointer_cast.pass.cpp:69
 #endif // TEST_STD_VER > 14
+#if TEST_STD_VER > 20
+    {
----------------



================
Comment at: libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp:116-127
       {
         B b;
         std::shared_ptr<B> pB(std::move(pA), &b);
         assert(A::count == 1);
         assert(B::count == 1);
         assert(pA.use_count() == 2);
         assert(pB.use_count() == 2);
----------------
I'd just remove this test. I don't really see the point of testing this, since it's questionable to rely on this behaviour and it's been changed with an LWG issue which some implementations back-port.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135548



More information about the libcxx-commits mailing list