Skip to content

Commit 471dbb9

Browse files
authored
[libc++] Replace __libcpp_is_final with a variable template (#167137)
1 parent 6ef174c commit 471dbb9

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

libcxx/include/__exception/nested_exception.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ template <class _Tp>
7373
__throw_with_nested<_Tp,
7474
_Up,
7575
is_class<_Up>::value && !is_base_of<nested_exception, _Up>::value &&
76-
!__libcpp_is_final<_Up>::value>::__do_throw(std::forward<_Tp>(__t));
76+
!__is_final_v<_Up> >::__do_throw(std::forward<_Tp>(__t));
7777
#else
7878
((void)__t);
7979
// FIXME: Make this abort

libcxx/include/__memory/compressed_pair.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ inline const size_t __compressed_pair_alignment<_Tp&> = _LIBCPP_ALIGNOF(void*);
6767

6868
template <class _ToPad>
6969
inline const bool __is_reference_or_unpadded_object =
70-
(is_empty<_ToPad>::value && !__libcpp_is_final<_ToPad>::value) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;
70+
(is_empty<_ToPad>::value && !__is_final_v<_ToPad>) || sizeof(_ToPad) == __datasizeof_v<_ToPad>;
7171

7272
template <class _Tp>
7373
inline const bool __is_reference_or_unpadded_object<_Tp&> = true;

libcxx/include/__type_traits/is_final.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _Tp>
22-
struct __libcpp_is_final : integral_constant<bool, __is_final(_Tp)> {};
22+
inline const bool __is_final_v = __is_final(_Tp);
2323

2424
#if _LIBCPP_STD_VER >= 14
2525
template <class _Tp>

libcxx/include/tuple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ using __tuple_common_comparison_category _LIBCPP_NODEBUG =
347347

348348
// __tuple_leaf
349349

350-
template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value >
350+
template <size_t _Ip, class _Hp, bool = is_empty<_Hp>::value && !__is_final_v<_Hp> >
351351
class __tuple_leaf;
352352

353353
template <size_t _Ip, class _Hp, bool _Ep>

libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/libcxx.control_block_layout.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
struct value_init_tag {};
3232

33-
template <class T, int _Idx, bool CanBeEmptyBase = std::is_empty<T>::value && !std::__libcpp_is_final<T>::value>
33+
template <class T, int _Idx, bool CanBeEmptyBase = std::is_empty<T>::value && !std::__is_final_v<T>>
3434
struct compressed_pair_elem {
3535
explicit compressed_pair_elem(value_init_tag) : value_() {}
3636

0 commit comments

Comments
 (0)