[libcxx-commits] [libcxx] [libc++] Make `constexpr std::variant`. Implement P2231R1 (PR #83335)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 8 12:15:19 PDT 2024


================
@@ -764,28 +767,27 @@ class _LIBCPP_TEMPLATE_VIS __dtor;
     public:                                                                                                            \
       using __base_type::__base_type;                                                                                  \
       using __base_type::operator=;                                                                                    \
-                                                                                                                       \
-      __dtor(const __dtor&)            = default;                                                                      \
-      __dtor(__dtor&&)                 = default;                                                                      \
-      __dtor& operator=(const __dtor&) = default;                                                                      \
-      __dtor& operator=(__dtor&&)      = default;                                                                      \
-      destructor;                                                                                                      \
+      _LIBCPP_HIDE_FROM_ABI __dtor(const __dtor&)            = default;                                                \
+      _LIBCPP_HIDE_FROM_ABI __dtor(__dtor&&)                 = default;                                                \
+      _LIBCPP_HIDE_FROM_ABI __dtor& operator=(const __dtor&) = default;                                                \
+      _LIBCPP_HIDE_FROM_ABI __dtor& operator=(__dtor&&)      = default;                                                \
+      destructor_definition;                                                                                           \
                                                                                                                        \
     protected:                                                                                                         \
-      inline _LIBCPP_HIDE_FROM_ABI destroy;                                                                            \
+      destroy;                                                                                                         \
     }
 
 _LIBCPP_VARIANT_DESTRUCTOR(
     _Trait::_TriviallyAvailable,
-    ~__dtor() = default, //
-    _LIBCPP_HIDE_FROM_ABI void __destroy() noexcept {
+    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__dtor() = default,
+    inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy() noexcept {
----------------
ldionne wrote:

I don't think `inline` is necessary here? Isn't it implicitly inline since it's defined in-class? Applies in a few places.

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


More information about the libcxx-commits mailing list