[libcxx-commits] [libcxx] [libcxx] Remove empty ~__no_destroy (PR #89882)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 24 02:07:36 PDT 2024


================
@@ -29,33 +29,25 @@ struct __uninitialized_tag {};
 // initialization using __emplace.
 template <class _Tp>
 struct __no_destroy {
-  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI explicit __no_destroy(__uninitialized_tag) : __dummy_() {
-    if (__libcpp_is_constant_evaluated()) {
-      __dummy_ = char();
-    }
-  }
-  _LIBCPP_HIDE_FROM_ABI ~__no_destroy() {
-    // nothing
-  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI explicit __no_destroy(__uninitialized_tag) {}
----------------
frederick-vs-ja wrote:

No change requested. The `constexpr` here needs to be kept, although it might be better to use `_LIBCPP_CONSTEXPR` here.

https://github.com/llvm/llvm-project/pull/89882


More information about the libcxx-commits mailing list