[libcxx-commits] [PATCH] D66262: Constrain tuple/unique_ptr move constructors (2899)
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 3 10:42:38 PST 2020
zoecarver added inline comments.
================
Comment at: libcxx/include/memory:2555
unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
-
----------------
ldionne wrote:
> zoecarver wrote:
> > mclow.lists wrote:
> > > Ok, this is just weird. Everywhere else in libc++, we avoid using `= delete` in C++03 mode, because it's not a thing.
> > > We even have a macro for it in `__config`:
> > > ```
> > > #ifdef _LIBCPP_CXX03_LANG
> > > # define _LIBCPP_EQUAL_DELETE
> > > #else
> > > # define _LIBCPP_EQUAL_DELETE = delete
> > > #endif
> > > ```
> > >
> > > And yet, here (twice!) we only do this for C++03.
> > > @EricWF added this in https://llvm.org/r364161; so I think he should explain.
> > Looks like it was just after we dropped support for GCC 4. He was probably just removing some of the C++03 clutter & cleaning up our implementation. But, I'll wait for him to respond.
> Ping @EricWF
Feel free to correct me Eric, but to elaborate on my original comment, I suspect this was just to "clean up our implementation." Looking at [[ https://github.com/llvm/llvm-project/commit/fb2bd4a9398b35ee4f732ea0847d9c1226fc4cf3#diff-0da905341f4329fb01473b012c4374bf81c1abf44dadb93cc2002ef013441401 | the commit ]], you can see that previously [[ https://github.com/llvm/llvm-project/commit/fb2bd4a9398b35ee4f732ea0847d9c1226fc4cf3#diff-0da905341f4329fb01473b012c4374bf81c1abf44dadb93cc2002ef013441401L2535-L2539 | these methods ]] were "deleted" in C++03 mode by declaring them privately. After we dropped GCC C++03 support we were able to use ` = delete` instead which is much more explicit. However, as far as I can tell, those methods weren't deleted in any way in the "normal" implementation, so that's probably why they were only applied to C++03 here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66262/new/
https://reviews.llvm.org/D66262
More information about the libcxx-commits
mailing list