[libcxx-commits] [libcxx] [libc++][NFC] Remove dead code implementing some tuple SFINAE checks (PR #79871)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 29 09:50:13 PST 2024
https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/79871
Some of the checks in sfinae_helpers.h were not used anymore since we refactored the std::tuple implementation and were now dead code. This patch removes the code.
>From 084bc02327098ff295d75e84be3aa223782b1bea Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Mon, 29 Jan 2024 12:48:23 -0500
Subject: [PATCH] [libc++][NFC] Remove dead code implementing some tuple SFINAE
checks
Some of the checks in sfinae_helpers.h were not used anymore since we
refactored the std::tuple implementation and were now dead code. This
patch removes the code.
---
libcxx/include/__tuple/sfinae_helpers.h | 32 -------------------
.../tuple_array_template_depth.pass.cpp | 2 +-
2 files changed, 1 insertion(+), 33 deletions(-)
diff --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h
index b57f2a4c2e754b0..90e9b1e5800478e 100644
--- a/libcxx/include/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__tuple/sfinae_helpers.h
@@ -18,9 +18,7 @@
#include <__tuple/tuple_types.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
-#include <__type_traits/is_assignable.h>
#include <__type_traits/is_constructible.h>
-#include <__type_traits/is_convertible.h>
#include <__type_traits/is_same.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/remove_reference.h>
@@ -49,25 +47,8 @@ struct __tuple_sfinae_base {
template <class _FromArgs, class _ToArgs>
using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{}));
- template <class _FromArgs, class _ToArgs>
- using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{}));
- template <class _FromArgs, class _ToArgs>
- using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{}));
};
-// __tuple_convertible
-
-template <class _Tp,
- class _Up,
- bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value>
-struct __tuple_convertible : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_convertible<_Tp, _Up, true, true>
- : public __tuple_sfinae_base::__convertible< typename __make_tuple_types<_Tp>::type,
- typename __make_tuple_types<_Up>::type > {};
-
// __tuple_constructible
template <class _Tp,
@@ -81,19 +62,6 @@ struct __tuple_constructible<_Tp, _Up, true, true>
: public __tuple_sfinae_base::__constructible< typename __make_tuple_types<_Tp>::type,
typename __make_tuple_types<_Up>::type > {};
-// __tuple_assignable
-
-template <class _Tp,
- class _Up,
- bool = __tuple_like_ext<__libcpp_remove_reference_t<_Tp> >::value,
- bool = __tuple_like_ext<_Up>::value>
-struct __tuple_assignable : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_assignable<_Tp, _Up, true, true>
- : public __tuple_sfinae_base::__assignable< typename __make_tuple_types<_Tp>::type,
- typename __make_tuple_types<_Up&>::type > {};
-
template <size_t _Ip, class... _Tp>
struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > {
typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
diff --git a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/tuple_array_template_depth.pass.cpp b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/tuple_array_template_depth.pass.cpp
index 3d4262f9a4211fb..b5a234ef20ffb9e 100644
--- a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/tuple_array_template_depth.pass.cpp
+++ b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/tuple_array_template_depth.pass.cpp
@@ -12,7 +12,7 @@
// template <class... Types> class tuple;
-// template <class Tuple, __tuple_assignable<Tuple, tuple> >
+// template <tuple-like Tuple>
// tuple & operator=(Tuple &&);
// This test checks that we do not evaluate __make_tuple_types
More information about the libcxx-commits
mailing list