[libcxx-commits] [libcxx] [libc++][NFC] Merge is{, _nothrow, _trivially}{, _copy, _move, _default}{_assignable, _constructible} (PR #85308)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 18 00:24:09 PDT 2024


================
@@ -66,6 +69,57 @@ template <class _Tp, class... _Args>
 inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
 #endif
 
+// TODO: remove this implementation once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is fixed
+#ifdef _LIBCPP_COMPILER_GCC
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
+    : public is_nothrow_constructible<_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type> > {};
+
+#else // _LIBCPP_COMPILER_GCC
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
+    : public integral_constant<
+          bool,
+          __is_nothrow_constructible(_Tp, typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
+
+#endif // _LIBCPP_COMPILER_GCC
+
+#if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
+#endif
+
+// TODO: remove this implementation once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is fixed
----------------
philnik777 wrote:

I know, but I'd rather avoid any drive-by fixes in this patch, since it's supposed to just move code around.

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


More information about the libcxx-commits mailing list