[libcxx-commits] [PATCH] D115986: [libc++] Allow __move_constexpr to work with unrelated pointers

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 18 09:17:15 PST 2021


Quuxplusone added a comment.

FWIW, I'm a little leery of how we're making these codepaths more and more complicated. If it wouldn't merge-conflict horribly with the "constexpr std::string" stuff, I would be very tempted to take a close look at all of these codepaths and see how they could be simplified.
For example, `__copy_constexpr` is an overload set: there's a `__copy_constexpr(T*, T*, size_t)` here in `<__string>` but also a `__copy_constexpr(In, In, Out)` in `<__algorithm/copy.h>` (which is tied up with all the `__unwrap_iter/__rewrap_iter` stuff). We don't need that overload set to exist.
For example, `__assign_constexpr` and this overload of `__copy_constexpr` are one-liners; they could probably just be inlined into their three callers.

Orthogonally, consider renaming `__s1` and `__s2` to `__src` and `__dest` respectively (or vice versa).

Orthogonally, I wonder if we're 100% sure that constexpr `new` and `delete` (as used here) are fully supported in Clang 13. Libc++ 14 will still have to work with Clang 13.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115986



More information about the libcxx-commits mailing list