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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 17 09:27:47 PDT 2022


Mordante added a subscriber: jwakely.
Mordante added inline comments.


================
Comment at: libcxx/include/__memory/shared_ptr.h:594
 
+#if _LIBCPP_STD_VER > 20
+    template <class _Yp>
----------------
pateldeev wrote:
> Mordante wrote:
> > Mordante wrote:
> > > Please update the synopsis too.
> > We (and other vendors) typically backport LWG-issue, can you do that for this issue too.
> I think back-porting to c++17 will break code that does a `std::move()` but relies on the fact that no move happens. Arguable this a just a bug in user code, but probably still something we don't want to change?
I don't feel that we should guard against users doing bad things; updating their code to C++20 will break that scenario.

I see MSVC STL applied this change unconditionally, but libstdc++ limits it to C++20 and newer.

@jwakely is there a reason for not backporting LWG-2996 to older versions?



================
Comment at: libcxx/include/__memory/shared_ptr.h:594
 
+#if _LIBCPP_STD_VER > 20
+    template <class _Yp>
----------------
Or remove it entirely.


================
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
+    {
----------------
Or removed, the same for other tests.


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