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

Jonathan Wakely via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 17 14:18:04 PDT 2022


jwakely added inline comments.


================
Comment at: libcxx/include/__memory/shared_ptr.h:594
 
+#if _LIBCPP_STD_VER > 20
+    template <class _Yp>
----------------
Mordante wrote:
> 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?
> 
I don't remember why I only added it for C++20, but probably because it's questionable whether there was a defect. It seems more like an evolutionary change (which is why it went through LEWG) than a defect fix.


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