Skip to content

Commit e43e8ec

Browse files
authored
[libc++] Remove dead implementation of is_nothrow_convertible and merge the remaining code into is_convertible.h (#137717)
We can use the `__is_nothrow_convertible` builtin unconditionally now, which makes the implementation very simple, so there isn't much of a need to keep a separate header around.
1 parent 15cd71a commit e43e8ec

File tree

5 files changed

+10
-68
lines changed

5 files changed

+10
-68
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@ set(files
835835
__type_traits/is_member_pointer.h
836836
__type_traits/is_nothrow_assignable.h
837837
__type_traits/is_nothrow_constructible.h
838-
__type_traits/is_nothrow_convertible.h
839838
__type_traits/is_nothrow_destructible.h
840839
__type_traits/is_null_pointer.h
841840
__type_traits/is_object.h

libcxx/include/__type_traits/is_convertible.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ template <class _From, class _To>
2626
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
2727
#endif
2828

29+
#if _LIBCPP_STD_VER >= 20
30+
31+
template <class _Tp, class _Up>
32+
struct _LIBCPP_NO_SPECIALIZATIONS is_nothrow_convertible : bool_constant<__is_nothrow_convertible(_Tp, _Up)> {};
33+
34+
template <class _Tp, class _Up>
35+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_nothrow_convertible_v = __is_nothrow_convertible(_Tp, _Up);
36+
37+
#endif // _LIBCPP_STD_VER >= 20
38+
2939
_LIBCPP_END_NAMESPACE_STD
3040

3141
#endif // _LIBCPP___TYPE_TRAITS_IS_CONVERTIBLE_H

libcxx/include/__type_traits/is_nothrow_convertible.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

libcxx/include/module.modulemap.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ module std_core [system] {
232232
header "__type_traits/is_nothrow_constructible.h"
233233
export std_core.type_traits.integral_constant
234234
}
235-
module is_nothrow_convertible {
236-
header "__type_traits/is_nothrow_convertible.h"
237-
export std_core.type_traits.integral_constant
238-
}
239235
module is_nothrow_destructible {
240236
header "__type_traits/is_nothrow_destructible.h"
241237
export std_core.type_traits.integral_constant

libcxx/include/type_traits

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ namespace std
549549
# include <__type_traits/common_reference.h>
550550
# include <__type_traits/is_bounded_array.h>
551551
# include <__type_traits/is_constant_evaluated.h>
552-
# include <__type_traits/is_nothrow_convertible.h>
553552
# include <__type_traits/is_unbounded_array.h>
554553
# include <__type_traits/type_identity.h>
555554
# include <__type_traits/unwrap_ref.h>

0 commit comments

Comments
 (0)