[llvm] [Support] Remove trivial_helper, is_copy_assignable, and is_move_assignable (PR #158007)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 00:14:45 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/158007

These seem to be all dead.  This patch removes them.


>From 88330ce66ab31679e5705d79a38696d12346f32a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 10 Sep 2025 18:29:30 -0700
Subject: [PATCH] [Support] Remove trivial_helper, is_copy_assignable, and
 is_move_assignable

These seem to be all dead.  This patch removes them.
---
 llvm/include/llvm/Support/type_traits.h | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
index 80713e17a56b9..a96125c16f11b 100644
--- a/llvm/include/llvm/Support/type_traits.h
+++ b/llvm/include/llvm/Support/type_traits.h
@@ -56,30 +56,6 @@ template <typename T> struct const_pointer_or_const_ref {
                          typename add_const_past_pointer<T>::type, const T &>;
 };
 
-namespace detail {
-template <class T> union trivial_helper {
-  T t;
-};
-
-} // namespace detail
-
-template <typename T> struct is_copy_assignable {
-  template <class F>
-  static auto get(F *)
-      -> decltype(std::declval<F &>() = std::declval<const F &>(),
-                  std::true_type{});
-  static std::false_type get(...);
-  static constexpr bool value = decltype(get((T *)nullptr))::value;
-};
-
-template <typename T> struct is_move_assignable {
-  template <class F>
-  static auto get(F *)
-      -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
-  static std::false_type get(...);
-  static constexpr bool value = decltype(get((T *)nullptr))::value;
-};
-
 } // namespace llvm
 
 #endif // LLVM_SUPPORT_TYPE_TRAITS_H



More information about the llvm-commits mailing list