[libc++] Replace __libcpp_is_final with a variable template (#167137)

This commit is contained in:
Nikolas Klauser 2025-11-10 11:00:05 +01:00 committed by GitHub
parent 6ef174c44c
commit 471dbb90cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ template <class _Tp>
__throw_with_nested<_Tp,
_Up,
is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&
!__libcpp_is_final<_Up>::value>::__do_throw(std::forward<_Tp>(__t));
!__is_final_v<_Up> >::__do_throw(std::forward<_Tp>(__t));
#else
((void)__t);
// FIXME: Make this abort

View File

@ -67,7 +67,7 @@ inline const size_t __compressed_pair_alignment<_Tp&> = _LIBCPP_ALIGNOF(void*);
template <class _ToPad>
inline const bool __is_reference_or_unpadded_object =
(is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;
(is_empty<_ToPad>::value && !__is_final_v<_ToPad>) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;
template <class _Tp>
inline const bool __is_reference_or_unpadded_object<_Tp&> = true;

View File

@ -19,7 +19,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct __libcpp_is_final : integral_constant<bool, __is_final(_Tp)> {};
inline const bool __is_final_v = __is_final(_Tp);
#if _LIBCPP_STD_VER >= 14
template <class _Tp>

View File

@ -347,7 +347,7 @@ using __tuple_common_comparison_category _LIBCPP_NODEBUG =
// __tuple_leaf
template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value >
template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__is_final_v<_Hp> >
class __tuple_leaf;
template <size_t _Ip, class _Hp, bool _Ep>

View File

@ -30,7 +30,7 @@
struct value_init_tag {};
template <class T, int _Idx, bool CanBeEmptyBase = std::is_empty<T>::value && !std::__libcpp_is_final<T>::value>
template <class T, int _Idx, bool CanBeEmptyBase = std::is_empty<T>::value && !std::__is_final_v<T>>
struct compressed_pair_elem {
explicit compressed_pair_elem(value_init_tag) : value_() {}