[PATCH] D24372: [libcxx] Sprinkle constexpr over compressed_pair

Keno Fischer via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 15:07:25 PDT 2016


loladiro added inline comments.

================
Comment at: include/memory:2137
@@ -2132,3 +2136,3 @@
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
     __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
----------------
mclow.lists wrote:
> loladiro wrote:
> > mclow.lists wrote:
> > > Have you tested this on C++11?
> > > I suspect that some of these need to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`
> > Well, as I mentioned there are other problems on C++11, namely forward not being constexpr (so even the simple constructors below can't be constant initialized in C++11). I would REALLY like for unique_ptr to be constant initialized even in C++11 mode. I feel like arguably the standard requires it by marking the constructor `constexpr`.
> One way to deal with that is to define a call `__forward()` that is the same as `forward()` except that it's constexpr in C++11, and have compressed_pair call that.
> 
I was worried that something in the definition of forward required C++14 constexpr semantics? Is that not the case. If so this sounds like a good solution, and I can update the patch accordingly.


Repository:
  rL LLVM

https://reviews.llvm.org/D24372





More information about the cfe-commits mailing list