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

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 17 20:55:40 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
----------------
h-vetinari wrote:

This is marked as a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100470

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


More information about the libcxx-commits mailing list