[libcxx-commits] [libcxx] 5fab33a - [libc++] Avoid instantiating type_trait classes

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 6 10:09:51 PDT 2022


Author: Nikolas Klauser
Date: 2022-09-06T19:09:42+02:00
New Revision: 5fab33af7f083a0043112742027172e9f297c07f

URL: https://github.com/llvm/llvm-project/commit/5fab33af7f083a0043112742027172e9f297c07f
DIFF: https://github.com/llvm/llvm-project/commit/5fab33af7f083a0043112742027172e9f297c07f.diff

LOG: [libc++] Avoid instantiating type_trait classes

Use `using` aliases to avoid instantiating lots of types

Reviewed By: ldionne, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D132785

Added: 
    

Modified: 
    libcxx/include/__algorithm/copy.h
    libcxx/include/__algorithm/half_positive.h
    libcxx/include/__algorithm/iterator_operations.h
    libcxx/include/__algorithm/move.h
    libcxx/include/__algorithm/move_backward.h
    libcxx/include/__algorithm/partition.h
    libcxx/include/__algorithm/ranges_iterator_concept.h
    libcxx/include/__algorithm/ranges_merge.h
    libcxx/include/__algorithm/ranges_partition.h
    libcxx/include/__algorithm/ranges_partition_copy.h
    libcxx/include/__algorithm/ranges_stable_partition.h
    libcxx/include/__algorithm/set_difference.h
    libcxx/include/__algorithm/stable_partition.h
    libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
    libcxx/include/__concepts/class_or_enum.h
    libcxx/include/__coroutine/coroutine_handle.h
    libcxx/include/__filesystem/path.h
    libcxx/include/__functional/bind.h
    libcxx/include/__functional/function.h
    libcxx/include/__functional/invoke.h
    libcxx/include/__hash_table
    libcxx/include/__iterator/distance.h
    libcxx/include/__iterator/iterator_traits.h
    libcxx/include/__iterator/move_iterator.h
    libcxx/include/__memory/allocator_arg_t.h
    libcxx/include/__memory/allocator_traits.h
    libcxx/include/__memory/pointer_traits.h
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/__memory/uninitialized_algorithms.h
    libcxx/include/__memory/unique_ptr.h
    libcxx/include/__node_handle
    libcxx/include/__numeric/gcd_lcm.h
    libcxx/include/__random/is_seed_sequence.h
    libcxx/include/__random/uniform_int_distribution.h
    libcxx/include/__split_buffer
    libcxx/include/__tree
    libcxx/include/__tuple/apply_cv.h
    libcxx/include/__tuple/make_tuple_types.h
    libcxx/include/__tuple/sfinae_helpers.h
    libcxx/include/__type_traits/add_lvalue_reference.h
    libcxx/include/__type_traits/add_pointer.h
    libcxx/include/__type_traits/add_rvalue_reference.h
    libcxx/include/__type_traits/apply_cv.h
    libcxx/include/__type_traits/can_extract_key.h
    libcxx/include/__type_traits/copy_cvref.h
    libcxx/include/__type_traits/decay.h
    libcxx/include/__type_traits/is_convertible.h
    libcxx/include/__type_traits/is_copy_assignable.h
    libcxx/include/__type_traits/is_copy_constructible.h
    libcxx/include/__type_traits/is_destructible.h
    libcxx/include/__type_traits/is_floating_point.h
    libcxx/include/__type_traits/is_integral.h
    libcxx/include/__type_traits/is_member_function_pointer.h
    libcxx/include/__type_traits/is_member_object_pointer.h
    libcxx/include/__type_traits/is_member_pointer.h
    libcxx/include/__type_traits/is_move_assignable.h
    libcxx/include/__type_traits/is_move_constructible.h
    libcxx/include/__type_traits/is_nothrow_copy_assignable.h
    libcxx/include/__type_traits/is_nothrow_copy_constructible.h
    libcxx/include/__type_traits/is_nothrow_destructible.h
    libcxx/include/__type_traits/is_nothrow_move_assignable.h
    libcxx/include/__type_traits/is_nothrow_move_constructible.h
    libcxx/include/__type_traits/is_null_pointer.h
    libcxx/include/__type_traits/is_pointer.h
    libcxx/include/__type_traits/is_reference_wrapper.h
    libcxx/include/__type_traits/is_swappable.h
    libcxx/include/__type_traits/is_trivially_copy_assignable.h
    libcxx/include/__type_traits/is_trivially_copy_constructible.h
    libcxx/include/__type_traits/is_trivially_move_assignable.h
    libcxx/include/__type_traits/is_trivially_move_constructible.h
    libcxx/include/__type_traits/is_void.h
    libcxx/include/__type_traits/make_const_lvalue_ref.h
    libcxx/include/__type_traits/make_signed.h
    libcxx/include/__type_traits/make_unsigned.h
    libcxx/include/__type_traits/remove_all_extents.h
    libcxx/include/__type_traits/remove_const.h
    libcxx/include/__type_traits/remove_const_ref.h
    libcxx/include/__type_traits/remove_cv.h
    libcxx/include/__type_traits/remove_cvref.h
    libcxx/include/__type_traits/remove_extent.h
    libcxx/include/__type_traits/remove_pointer.h
    libcxx/include/__type_traits/remove_reference.h
    libcxx/include/__type_traits/remove_volatile.h
    libcxx/include/__utility/forward.h
    libcxx/include/__utility/in_place.h
    libcxx/include/__utility/move.h
    libcxx/include/any
    libcxx/include/atomic
    libcxx/include/experimental/coroutine
    libcxx/include/experimental/functional
    libcxx/include/experimental/propagate_const
    libcxx/include/experimental/simd
    libcxx/include/ext/hash_map
    libcxx/include/forward_list
    libcxx/include/future
    libcxx/include/limits
    libcxx/include/list
    libcxx/include/locale
    libcxx/include/new
    libcxx/include/optional
    libcxx/include/scoped_allocator
    libcxx/include/thread
    libcxx/include/tuple
    libcxx/include/valarray
    libcxx/include/variant
    libcxx/src/string.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h
index a9441ffdc968b..d6a46f69523a8 100644
--- a/libcxx/include/__algorithm/copy.h
+++ b/libcxx/include/__algorithm/copy.h
@@ -40,7 +40,7 @@ pair<_InIter, _OutIter> __copy_impl(_InIter __first, _Sent __last, _OutIter __re
 
 template <class _InValueT,
           class _OutValueT,
-          class = __enable_if_t<is_same<typename remove_const<_InValueT>::type, _OutValueT>::value
+          class = __enable_if_t<is_same<__remove_const_t<_InValueT>, _OutValueT>::value
                              && is_trivially_copy_assignable<_OutValueT>::value> >
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
 pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, _OutValueT* __result) {
@@ -58,7 +58,7 @@ pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last,
 }
 
 template <class _InIter, class _OutIter,
-          __enable_if_t<is_same<typename remove_const<__iter_value_type<_InIter> >::type, __iter_value_type<_OutIter> >::value
+          __enable_if_t<is_same<__remove_const_t<__iter_value_type<_InIter> >, __iter_value_type<_OutIter> >::value
                       && __is_cpp17_contiguous_iterator<typename _InIter::iterator_type>::value
                       && __is_cpp17_contiguous_iterator<typename _OutIter::iterator_type>::value
                       && is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value

diff  --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h
index 7666ef1449c67..74aede2b56686 100644
--- a/libcxx/include/__algorithm/half_positive.h
+++ b/libcxx/include/__algorithm/half_positive.h
@@ -29,7 +29,7 @@ typename enable_if
 >::type
 __half_positive(_Integral __value)
 {
-    return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2);
+    return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2);
 }
 
 template <typename _Tp>

diff  --git a/libcxx/include/__algorithm/iterator_operations.h b/libcxx/include/__algorithm/iterator_operations.h
index c9ec66b49f428..bfe82c2028f32 100644
--- a/libcxx/include/__algorithm/iterator_operations.h
+++ b/libcxx/include/__algorithm/iterator_operations.h
@@ -97,7 +97,7 @@ struct _IterOps<_ClassicAlgPolicy> {
   template <class _Iter>
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
   static void __validate_iter_reference() {
-    static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__uncvref_t<_Iter> >::reference>::value,
+    static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__remove_cvref_t<_Iter> >::reference>::value,
         "It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of "
         "dereferencing the iterator, i.e., calling `*it`. This is undefined behavior according to [input.iterators] "
         "and can lead to dangling reference issues at runtime, so we are flagging this.");
@@ -147,16 +147,16 @@ struct _IterOps<_ClassicAlgPolicy> {
 
   template <class _Iter>
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14
-  __uncvref_t<_Iter> next(_Iter&& __it,
-                          typename iterator_traits<__uncvref_t<_Iter> >::
diff erence_type __n = 1) {
+  __remove_cvref_t<_Iter> next(_Iter&& __it,
+                          typename iterator_traits<__remove_cvref_t<_Iter> >::
diff erence_type __n = 1) {
     return std::next(std::forward<_Iter>(__it), __n);
   }
 
   // prev
   template <class _Iter>
   _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14
-  __uncvref_t<_Iter> prev(_Iter&& __iter,
-                 typename iterator_traits<__uncvref_t<_Iter> >::
diff erence_type __n = 1) {
+  __remove_cvref_t<_Iter> prev(_Iter&& __iter,
+                 typename iterator_traits<__remove_cvref_t<_Iter> >::
diff erence_type __n = 1) {
     return std::prev(std::forward<_Iter>(__iter), __n);
   }
 

diff  --git a/libcxx/include/__algorithm/move.h b/libcxx/include/__algorithm/move.h
index ced3a7a3f6fb1..e2f8b22800dbc 100644
--- a/libcxx/include/__algorithm/move.h
+++ b/libcxx/include/__algorithm/move.h
@@ -41,7 +41,7 @@ pair<_InIter, _OutIter> __move_impl(_InIter __first, _Sent __last, _OutIter __re
 template <class _AlgPolicy,
           class _InType,
           class _OutType,
-          class = __enable_if_t<is_same<typename remove_const<_InType>::type, _OutType>::value
+          class = __enable_if_t<is_same<__remove_const_t<_InType>, _OutType>::value
                              && is_trivially_move_assignable<_OutType>::value> >
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
 pair<_InType*, _OutType*> __move_impl(_InType* __first, _InType* __last, _OutType* __result) {
@@ -70,7 +70,7 @@ struct __is_trivially_move_assignable_unwrapped
 template <class _AlgPolicy,
           class _InIter,
           class _OutIter,
-          __enable_if_t<is_same<typename remove_const<typename iterator_traits<_InIter>::value_type>::type,
+          __enable_if_t<is_same<__remove_const_t<typename iterator_traits<_InIter>::value_type>,
                                 typename iterator_traits<_OutIter>::value_type>::value
                      && __is_cpp17_contiguous_iterator<_InIter>::value
                      && __is_cpp17_contiguous_iterator<_OutIter>::value

diff  --git a/libcxx/include/__algorithm/move_backward.h b/libcxx/include/__algorithm/move_backward.h
index 1f1abe91f0040..02aae26fc4499 100644
--- a/libcxx/include/__algorithm/move_backward.h
+++ b/libcxx/include/__algorithm/move_backward.h
@@ -44,7 +44,7 @@ template <class _AlgPolicy, class _Tp, class _Up>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
 typename enable_if
 <
-    is_same<typename remove_const<_Tp>::type, _Up>::value &&
+    is_same<__remove_const_t<_Tp>, _Up>::value &&
     is_trivially_move_assignable<_Up>::value,
     _Up*
 >::type

diff  --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h
index 867d43b85af67..0e094bf8dd924 100644
--- a/libcxx/include/__algorithm/partition.h
+++ b/libcxx/include/__algorithm/partition.h
@@ -79,7 +79,7 @@ template <class _AlgPolicy, class _ForwardIterator, class _Sentinel, class _Pred
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 pair<_ForwardIterator, _ForwardIterator> __partition(
     _ForwardIterator __first, _Sentinel __last, _Predicate&& __pred, _IterCategory __iter_category) {
-  return std::__partition_impl<__uncvref_t<_Predicate>&, _AlgPolicy>(
+  return std::__partition_impl<__remove_cvref_t<_Predicate>&, _AlgPolicy>(
       std::move(__first), std::move(__last), __pred, __iter_category);
 }
 

diff  --git a/libcxx/include/__algorithm/ranges_iterator_concept.h b/libcxx/include/__algorithm/ranges_iterator_concept.h
index 82ae3848c7a44..c2a508dc9a292 100644
--- a/libcxx/include/__algorithm/ranges_iterator_concept.h
+++ b/libcxx/include/__algorithm/ranges_iterator_concept.h
@@ -26,7 +26,7 @@ namespace ranges {
 
 template <class _IterMaybeQualified>
 consteval auto __get_iterator_concept() {
-  using _Iter = __uncvref_t<_IterMaybeQualified>;
+  using _Iter = __remove_cvref_t<_IterMaybeQualified>;
 
   if constexpr (contiguous_iterator<_Iter>)
     return contiguous_iterator_tag();

diff  --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h
index 394a466ad34be..b36a05abc41e1 100644
--- a/libcxx/include/__algorithm/ranges_merge.h
+++ b/libcxx/include/__algorithm/ranges_merge.h
@@ -47,7 +47,7 @@ template <
     class _Comp,
     class _Proj1,
     class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__uncvref_t<_InIter1>, __uncvref_t<_InIter2>, __uncvref_t<_OutIter>>
+_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__remove_cvref_t<_InIter1>, __remove_cvref_t<_InIter2>, __remove_cvref_t<_OutIter>>
 __merge_impl(
     _InIter1&& __first1,
     _Sent1&& __last1,

diff  --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h
index eaa696d82f82a..8b3aae5c250d8 100644
--- a/libcxx/include/__algorithm/ranges_partition.h
+++ b/libcxx/include/__algorithm/ranges_partition.h
@@ -44,7 +44,7 @@ struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
   _LIBCPP_HIDE_FROM_ABI static constexpr
-  subrange<__uncvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
+  subrange<__remove_cvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
     auto&& __projected_pred = std::__make_projected(__pred, __proj);
     auto __result = std::__partition<_RangeAlgPolicy>(
         std::move(__first), std::move(__last), __projected_pred, __iterator_concept<_Iter>());

diff  --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h
index 31e04ef7c7844..e7a9a347df5ad 100644
--- a/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -43,7 +43,7 @@ struct __fn {
   template <class _InIter, class _Sent, class _OutIter1, class _OutIter2, class _Proj, class _Pred>
   _LIBCPP_HIDE_FROM_ABI constexpr
   static partition_copy_result<
-      __uncvref_t<_InIter>, __uncvref_t<_OutIter1>, __uncvref_t<_OutIter2>
+      __remove_cvref_t<_InIter>, __remove_cvref_t<_OutIter1>, __remove_cvref_t<_OutIter2>
   > __partition_copy_fn_impl( _InIter&& __first, _Sent&& __last, _OutIter1&& __out_true, _OutIter2&& __out_false,
       _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {

diff  --git a/libcxx/include/__algorithm/ranges_stable_partition.h b/libcxx/include/__algorithm/ranges_stable_partition.h
index ecafeb7c49a55..c3469f17c7d7b 100644
--- a/libcxx/include/__algorithm/ranges_stable_partition.h
+++ b/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -45,7 +45,7 @@ struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
   _LIBCPP_HIDE_FROM_ABI static
-  subrange<__uncvref_t<_Iter>> __stable_partition_fn_impl(
+  subrange<__remove_cvref_t<_Iter>> __stable_partition_fn_impl(
       _Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 

diff  --git a/libcxx/include/__algorithm/set_
diff erence.h b/libcxx/include/__algorithm/set_
diff erence.h
index 668bb95ae0926..2b219e41cc83b 100644
--- a/libcxx/include/__algorithm/set_
diff erence.h
+++ b/libcxx/include/__algorithm/set_
diff erence.h
@@ -27,7 +27,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template < class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__uncvref_t<_InIter1>, __uncvref_t<_OutIter> >
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__remove_cvref_t<_InIter1>, __remove_cvref_t<_OutIter> >
 __set_
diff erence(
     _InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) {
   while (__first1 != __last1 && __first2 != __last2) {

diff  --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h
index b85acc7552075..1beb9c3193d0d 100644
--- a/libcxx/include/__algorithm/stable_partition.h
+++ b/libcxx/include/__algorithm/stable_partition.h
@@ -309,7 +309,7 @@ template <class _AlgPolicy, class _Predicate, class _ForwardIterator, class _Ite
 _LIBCPP_HIDE_FROM_ABI
 _ForwardIterator __stable_partition(
     _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred, _IterCategory __iter_category) {
-  return std::__stable_partition_impl<_AlgPolicy, __uncvref_t<_Predicate>&>(
+  return std::__stable_partition_impl<_AlgPolicy, __remove_cvref_t<_Predicate>&>(
       std::move(__first), std::move(__last), __pred, __iter_category);
 }
 

diff  --git a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
index 7d0d3e196e18f..1e86074b3dbd0 100644
--- a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -42,9 +42,9 @@ class _ClassicGenAdaptor {
   using result_type = invoke_result_t<_Gen&>;
 
   _LIBCPP_HIDE_FROM_ABI
-  static constexpr auto min() { return __uncvref_t<_Gen>::min(); }
+  static constexpr auto min() { return __remove_cvref_t<_Gen>::min(); }
   _LIBCPP_HIDE_FROM_ABI
-  static constexpr auto max() { return __uncvref_t<_Gen>::max(); }
+  static constexpr auto max() { return __remove_cvref_t<_Gen>::max(); }
 
   _LIBCPP_HIDE_FROM_ABI
   constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen_(__g) {}

diff  --git a/libcxx/include/__concepts/class_or_enum.h b/libcxx/include/__concepts/class_or_enum.h
index 9fd62ba892434..6287c5299239e 100644
--- a/libcxx/include/__concepts/class_or_enum.h
+++ b/libcxx/include/__concepts/class_or_enum.h
@@ -28,7 +28,7 @@ concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
 // Work around Clang bug https://llvm.org/PR52970
 // TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
 template<class _Tp>
-concept __workaround_52970 = is_class_v<__uncvref_t<_Tp>> || is_union_v<__uncvref_t<_Tp>>;
+concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;
 
 #endif // _LIBCPP_STD_VER > 17
 

diff  --git a/libcxx/include/__coroutine/coroutine_handle.h b/libcxx/include/__coroutine/coroutine_handle.h
index 4bf323789217e..63c275f814a14 100644
--- a/libcxx/include/__coroutine/coroutine_handle.h
+++ b/libcxx/include/__coroutine/coroutine_handle.h
@@ -115,7 +115,7 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
 
     _LIBCPP_HIDE_FROM_ABI
     static coroutine_handle from_promise(_Promise& __promise) {
-        using _RawPromise = typename remove_cv<_Promise>::type;
+        using _RawPromise = __remove_cv_t<_Promise>;
         coroutine_handle __tmp;
         __tmp.__handle_ =
             __builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true);

diff  --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 6307b594a888f..7d1a784403b8d 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -141,15 +141,15 @@ struct __is_pathable_string<
 
 template <class _Source, class _DS = typename decay<_Source>::type,
           class _UnqualPtrType =
-              typename remove_const<typename remove_pointer<_DS>::type>::type,
+              __remove_const_t<__remove_pointer_t<_DS> >,
           bool _IsCharPtr = is_pointer<_DS>::value&&
               __can_convert_char<_UnqualPtrType>::value>
 struct __is_pathable_char_array : false_type {};
 
 template <class _Source, class _ECharT, class _UPtr>
 struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
-    : __can_convert_char<typename remove_const<_ECharT>::type> {
-  using _Base = __can_convert_char<typename remove_const<_ECharT>::type>;
+    : __can_convert_char<__remove_const_t<_ECharT> > {
+  using _Base = __can_convert_char<__remove_const_t<_ECharT> >;
 
   _LIBCPP_HIDE_FROM_ABI
   static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }

diff  --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index 1cf72ce230f6f..297e4e5103a32 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -25,9 +25,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template<class _Tp>
 struct is_bind_expression : _If<
-    _IsSame<_Tp, __uncvref_t<_Tp> >::value,
+    _IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
     false_type,
-    is_bind_expression<__uncvref_t<_Tp> >
+    is_bind_expression<__remove_cvref_t<_Tp> >
 > {};
 
 #if _LIBCPP_STD_VER > 14
@@ -37,9 +37,9 @@ inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
 
 template<class _Tp>
 struct is_placeholder : _If<
-    _IsSame<_Tp, __uncvref_t<_Tp> >::value,
+    _IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
     integral_constant<int, 0>,
-    is_placeholder<__uncvref_t<_Tp> >
+    is_placeholder<__remove_cvref_t<_Tp> >
 > {};
 
 #if _LIBCPP_STD_VER > 14
@@ -279,7 +279,7 @@ class __bind : public __weak_result_type<typename decay<_Fp>::type>
               class = typename enable_if
                                <
                                   is_constructible<_Fd, _Gp>::value &&
-                                  !is_same<typename remove_reference<_Gp>::type,
+                                  !is_same<__libcpp_remove_reference_t<_Gp>,
                                            __bind>::value
                                >::type>
       _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -324,7 +324,7 @@ class __bind_r
               class = typename enable_if
                                <
                                   is_constructible<_Fd, _Gp>::value &&
-                                  !is_same<typename remove_reference<_Gp>::type,
+                                  !is_same<__libcpp_remove_reference_t<_Gp>,
                                            __bind_r>::value
                                >::type>
       _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20

diff  --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index 8a4a2cfc57f79..e8bcb6b737895 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -974,7 +974,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
     __func __f_;
 
     template <class _Fp, bool = _And<
-        _IsNotSame<__uncvref_t<_Fp>, function>,
+        _IsNotSame<__remove_cvref_t<_Fp>, function>,
         __invokable<_Fp, _ArgTypes...>
     >::value>
     struct __callable;

diff  --git a/libcxx/include/__functional/invoke.h b/libcxx/include/__functional/invoke.h
index ce3e0aa515ff7..39641505a5073 100644
--- a/libcxx/include/__functional/invoke.h
+++ b/libcxx/include/__functional/invoke.h
@@ -248,7 +248,7 @@ struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
 
 template <class _MP>
 struct __member_pointer_traits
-    : public __member_pointer_traits_imp<typename remove_cv<_MP>::type,
+    : public __member_pointer_traits_imp<__remove_cv_t<_MP>,
                     is_member_function_pointer<_MP>::value,
                     is_member_object_pointer<_MP>::value>
 {

diff  --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index 5a72ccfeb5443..bd456898ad59c 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -57,7 +57,7 @@ template <class ..._Args>
 struct __is_hash_value_type : false_type {};
 
 template <class _One>
-struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__uncvref_t<_One> > {};
+struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
 
 _LIBCPP_FUNC_VIS
 size_t __next_prime(size_t __n);
@@ -67,7 +67,7 @@ struct __hash_node_base
 {
     typedef typename pointer_traits<_NodePtr>::element_type __node_type;
     typedef __hash_node_base __first_node;
-    typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer;
+    typedef __rebind_pointer_t<_NodePtr, __first_node> __node_base_pointer;
     typedef _NodePtr __node_pointer;
 
 #if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB)
@@ -105,7 +105,7 @@ template <class _Tp, class _VoidPtr>
 struct _LIBCPP_STANDALONE_DEBUG __hash_node
     : public __hash_node_base
              <
-                 typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
+                 __rebind_pointer_t<_VoidPtr, __hash_node<_Tp, _VoidPtr> >
              >
 {
     typedef _Tp __node_value_type;
@@ -217,9 +217,9 @@ struct __hash_map_pointer_types {};
 template <class _Tp, class _AllocPtr, class _KVTypes>
 struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
   typedef typename _KVTypes::__map_value_type   _Mv;
-  typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
+  typedef __rebind_pointer_t<_AllocPtr, _Mv>
                                                        __map_value_type_pointer;
-  typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
+  typedef __rebind_pointer_t<_AllocPtr, const _Mv>
                                                  __const_map_value_type_pointer;
 };
 
@@ -237,21 +237,21 @@ public:
   typedef ptr
diff _t 
diff erence_type;
   typedef size_t size_type;
 
-  typedef typename __rebind_pointer<_NodePtr, void>::type       __void_pointer;
+  typedef __rebind_pointer_t<_NodePtr, void>       __void_pointer;
 
   typedef typename pointer_traits<_NodePtr>::element_type       __node_type;
   typedef _NodePtr                                              __node_pointer;
 
   typedef __hash_node_base<__node_pointer>                      __node_base_type;
-  typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type
+  typedef __rebind_pointer_t<_NodePtr, __node_base_type>
                                                              __node_base_pointer;
 
   typedef typename __node_base_type::__next_pointer          __next_pointer;
 
   typedef _Tp                                                 __node_value_type;
-  typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, __node_value_type>
                                                       __node_value_type_pointer;
-  typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, const __node_value_type>
                                                 __const_node_value_type_pointer;
 
 private:
@@ -259,7 +259,7 @@ private:
                 "_NodePtr should never be a pointer to const");
     static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),
                   "_VoidPtr does not point to unqualified void type");
-    static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
+    static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>,
                           _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
 };
 
@@ -278,7 +278,7 @@ struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > :
 template <class _NodeValueTp, class _VoidPtr>
 struct __make_hash_node_types {
   typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;
-  typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr;
+  typedef __rebind_pointer_t<_VoidPtr, _NodeTp> _NodePtr;
   typedef __hash_node_types<_NodePtr> type;
 };
 
@@ -623,8 +623,8 @@ class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator
 
     typedef pointer_traits<__node_pointer>          __pointer_traits;
     typedef typename __pointer_traits::element_type __node;
-    typedef typename remove_const<__node>::type     __non_const_node;
-    typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type
+    typedef __remove_const_t<__node>                  __non_const_node;
+    typedef __rebind_pointer_t<__node_pointer, __non_const_node>
         __non_const_node_pointer;
 public:
     typedef __hash_local_iterator<__non_const_node_pointer>

diff  --git a/libcxx/include/__iterator/distance.h b/libcxx/include/__iterator/distance.h
index ee6c78efcbfac..32e41331f68c5 100644
--- a/libcxx/include/__iterator/distance.h
+++ b/libcxx/include/__iterator/distance.h
@@ -75,7 +75,7 @@ struct __fn {
   template<class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
   _LIBCPP_HIDE_FROM_ABI
   constexpr iter_
diff erence_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
-    if constexpr (sized_sentinel_for<_Sp, __uncvref_t<_Ip>>) {
+    if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {
       return __last - __first;
     } else {
       return __last - decay_t<_Ip>(__first);

diff  --git a/libcxx/include/__iterator/iterator_traits.h b/libcxx/include/__iterator/iterator_traits.h
index 35d68de2d49c0..e8c853767a7be 100644
--- a/libcxx/include/__iterator/iterator_traits.h
+++ b/libcxx/include/__iterator/iterator_traits.h
@@ -408,7 +408,7 @@ requires is_object_v<_Tp>
 struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
 {
     typedef ptr
diff _t 
diff erence_type;
-    typedef typename remove_cv<_Tp>::type value_type;
+    typedef __remove_cv_t<_Tp> value_type;
     typedef _Tp* pointer;
     typedef _Tp& reference;
     typedef random_access_iterator_tag iterator_category;
@@ -493,7 +493,7 @@ template<class _InputIterator>
 using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
 
 template<class _InputIterator>
-using __iter_key_type = typename remove_const<typename iterator_traits<_InputIterator>::value_type::first_type>::type;
+using __iter_key_type = __remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
 
 template<class _InputIterator>
 using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type;

diff  --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h
index 475868b8281e9..b02bd81bfc81a 100644
--- a/libcxx/include/__iterator/move_iterator.h
+++ b/libcxx/include/__iterator/move_iterator.h
@@ -82,7 +82,7 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
     typedef typename iterator_traits<iterator_type>::reference __reference;
     typedef typename conditional<
             is_reference<__reference>::value,
-            typename remove_reference<__reference>::type&&,
+            __libcpp_remove_reference_t<__reference>&&,
             __reference
         >::type reference;
 #endif // _LIBCPP_STD_VER > 17

diff  --git a/libcxx/include/__memory/allocator_arg_t.h b/libcxx/include/__memory/allocator_arg_t.h
index 2d63b1f905e59..44df046ed7894 100644
--- a/libcxx/include/__memory/allocator_arg_t.h
+++ b/libcxx/include/__memory/allocator_arg_t.h
@@ -36,7 +36,7 @@ extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
 template <class _Tp, class _Alloc, class ..._Args>
 struct __uses_alloc_ctor_imp
 {
-    typedef _LIBCPP_NODEBUG __uncvref_t<_Alloc> _RawAlloc;
+    typedef _LIBCPP_NODEBUG __remove_cvref_t<_Alloc> _RawAlloc;
     static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
     static const bool __ic =
         is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;

diff  --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h
index 95ccaf8493e6f..d184be24c2103 100644
--- a/libcxx/include/__memory/allocator_traits.h
+++ b/libcxx/include/__memory/allocator_traits.h
@@ -33,7 +33,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // __pointer
 _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
 template <class _Tp, class _Alloc,
-          class _RawAlloc = typename remove_reference<_Alloc>::type,
+          class _RawAlloc = __libcpp_remove_reference_t<_Alloc>,
           bool = __has_pointer<_RawAlloc>::value>
 struct __pointer {
     using type _LIBCPP_NODEBUG = typename _RawAlloc::pointer;

diff  --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h
index c9541e85adf14..f4f571c64be91 100644
--- a/libcxx/include/__memory/pointer_traits.h
+++ b/libcxx/include/__memory/pointer_traits.h
@@ -151,14 +151,13 @@ struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
         {return _VSTD::addressof(__r);}
 };
 
-template <class _From, class _To>
-struct __rebind_pointer {
 #ifndef _LIBCPP_CXX03_LANG
-    typedef typename pointer_traits<_From>::template rebind<_To>        type;
+template <class _From, class _To>
+using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>;
 #else
-    typedef typename pointer_traits<_From>::template rebind<_To>::other type;
+template <class _From, class _To>
+using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>::other;
 #endif
-};
 
 // to_address
 

diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index b350bcdac444c..238d765f3ebb0 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -690,7 +690,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         {
             typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
             typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
-                                        reference_wrapper<typename remove_reference<_Dp>::type>,
+                                        reference_wrapper<__libcpp_remove_reference_t<_Dp> >,
                                         _AllocT> _CntrlBlk;
             __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT());
             __enable_weak_this(__r.get(), __r.get());
@@ -805,7 +805,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     _LIBCPP_HIDE_FROM_ABI
-    typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
+    __add_lvalue_reference_t<element_type> operator*() const _NOEXCEPT
     {
         return *__ptr_;
     }
@@ -858,7 +858,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
 
 #if _LIBCPP_STD_VER > 14
     _LIBCPP_HIDE_FROM_ABI
-    typename add_lvalue_reference<element_type>::type operator[](ptr
diff _t __i) const
+    __add_lvalue_reference_t<element_type> operator[](ptr
diff _t __i) const
     {
             static_assert(is_array<_Tp>::value,
                           "std::shared_ptr<T>::operator[] is only valid when T is an array type.");
@@ -907,7 +907,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     _LIBCPP_HIDE_FROM_ABI
     void __enable_weak_this(const enable_shared_from_this<_Yp>* __e, _OrigPtr* __ptr) _NOEXCEPT
     {
-        typedef typename remove_cv<_Yp>::type _RawYp;
+        typedef __remove_cv_t<_Yp> _RawYp;
         if (__e && __e->__weak_this_.expired())
         {
             __e->__weak_this_ = shared_ptr<_RawYp>(*this,

diff  --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index 6a7b7087ab7f5..22f96d4e05eb2 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -558,7 +558,7 @@ struct __allocator_has_trivial_copy_construct<allocator<_Type>, _Type> : true_ty
 
 template <class _Alloc,
           class _Type,
-          class _RawType = typename remove_const<_Type>::type,
+          class _RawType = __remove_const_t<_Type>,
           __enable_if_t<
               // using _RawType because of the allocator<T const> extension
               is_trivially_copy_constructible<_RawType>::value && is_trivially_copy_assignable<_RawType>::value &&

diff  --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 399db50ad1199..9fed6197a1fdd 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -251,7 +251,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
     return *this;
   }
 
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type operator*() const {
+  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const {
     return *__ptr_.first();
   }
   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT {
@@ -448,7 +448,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
     return *this;
   }
 
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type
+  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp>
   operator[](size_t __i) const {
     return __ptr_.first()[__i];
   }
@@ -673,7 +673,7 @@ make_unique(_Args&&... __args) {
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_array_unknown_bound
 make_unique(size_t __n) {
-  typedef typename remove_extent<_Tp>::type _Up;
+  typedef __remove_extent_t<_Tp> _Up;
   return unique_ptr<_Tp>(new _Up[__n]());
 }
 

diff  --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle
index 8cb6d625a85a1..bc49272b9f1c1 100644
--- a/libcxx/include/__node_handle
+++ b/libcxx/include/__node_handle
@@ -91,8 +91,8 @@ class _LIBCPP_TEMPLATE_VIS __basic_node_handle
         _NodeType, __basic_node_handle<_NodeType, _Alloc, _MapOrSetSpecifics>>;
 
     typedef allocator_traits<_Alloc> __alloc_traits;
-    typedef typename __rebind_pointer<typename __alloc_traits::void_pointer,
-                                      _NodeType>::type
+    typedef __rebind_pointer_t<typename __alloc_traits::void_pointer,
+                                      _NodeType>
         __node_pointer_type;
 
 public:

diff  --git a/libcxx/include/__numeric/gcd_lcm.h b/libcxx/include/__numeric/gcd_lcm.h
index 9a53a001f2114..b3d776b3a44fe 100644
--- a/libcxx/include/__numeric/gcd_lcm.h
+++ b/libcxx/include/__numeric/gcd_lcm.h
@@ -60,8 +60,8 @@ common_type_t<_Tp,_Up>
 gcd(_Tp __m, _Up __n)
 {
     static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
-    static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" );
-    static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
+    static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to gcd cannot be bool" );
+    static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to gcd cannot be bool" );
     using _Rp = common_type_t<_Tp,_Up>;
     using _Wp = make_unsigned_t<_Rp>;
     return static_cast<_Rp>(_VSTD::__gcd(
@@ -75,8 +75,8 @@ common_type_t<_Tp,_Up>
 lcm(_Tp __m, _Up __n)
 {
     static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
-    static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" );
-    static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" );
+    static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to lcm cannot be bool" );
+    static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to lcm cannot be bool" );
     if (__m == 0 || __n == 0)
         return 0;
 

diff  --git a/libcxx/include/__random/is_seed_sequence.h b/libcxx/include/__random/is_seed_sequence.h
index a6832f51c1eea..3c82b2790b035 100644
--- a/libcxx/include/__random/is_seed_sequence.h
+++ b/libcxx/include/__random/is_seed_sequence.h
@@ -23,7 +23,7 @@ struct __is_seed_sequence
 {
     static _LIBCPP_CONSTEXPR const bool value =
               !is_convertible<_Sseq, typename _Engine::result_type>::value &&
-              !is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
+              !is_same<__remove_cv_t<_Sseq>, _Engine>::value;
 };
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h
index 51e3a915484f7..dcc21925e0374 100644
--- a/libcxx/include/__random/uniform_int_distribution.h
+++ b/libcxx/include/__random/uniform_int_distribution.h
@@ -238,7 +238,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 {
     static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
     typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), uint32_t,
-                                 typename make_unsigned<result_type>::type>::type _UIntType;
+                                 __make_unsigned_t<result_type> >::type _UIntType;
     const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
     if (_Rp == 1)
         return __p.a();

diff  --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 2ffa0086d1bd0..1754baacd76ab 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -51,7 +51,7 @@ private:
 public:
     typedef _Tp                                             value_type;
     typedef _Allocator                                      allocator_type;
-    typedef typename remove_reference<allocator_type>::type __alloc_rr;
+    typedef __libcpp_remove_reference_t<allocator_type>     __alloc_rr;
     typedef allocator_traits<__alloc_rr>                    __alloc_traits;
     typedef value_type&                                     reference;
     typedef const value_type&                               const_reference;
@@ -67,8 +67,8 @@ public:
     pointer                                         __end_;
     __compressed_pair<pointer, allocator_type> __end_cap_;
 
-    typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
-    typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;
+    typedef __add_lvalue_reference_t<allocator_type> __alloc_ref;
+    typedef __add_lvalue_reference_t<allocator_type> __alloc_const_ref;
 
     _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr&           __alloc() _NOEXCEPT         {return __end_cap_.second();}
     _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr&     __alloc() const _NOEXCEPT   {return __end_cap_.second();}

diff  --git a/libcxx/include/__tree b/libcxx/include/__tree
index b4e9569ab0fbb..4dd48967ddf99 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -560,7 +560,7 @@ template <class ..._Args>
 struct __is_tree_value_type : false_type {};
 
 template <class _One>
-struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__uncvref_t<_One> > {};
+struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__remove_cvref_t<_One> > {};
 
 template <class _Tp>
 struct __tree_key_value_types {
@@ -638,11 +638,11 @@ struct __tree_node_base_types {
   typedef _VoidPtr                                               __void_pointer;
 
   typedef __tree_node_base<__void_pointer>                      __node_base_type;
-  typedef typename __rebind_pointer<_VoidPtr, __node_base_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, __node_base_type>
                                                              __node_base_pointer;
 
   typedef __tree_end_node<__node_base_pointer>                  __end_node_type;
-  typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, __end_node_type>
                                                              __end_node_pointer;
 #if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
   typedef __end_node_pointer __parent_pointer;
@@ -665,9 +665,9 @@ struct __tree_map_pointer_types {};
 template <class _Tp, class _AllocPtr, class _KVTypes>
 struct __tree_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
   typedef typename _KVTypes::__map_value_type   _Mv;
-  typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
+  typedef __rebind_pointer_t<_AllocPtr, _Mv>
                                                        __map_value_type_pointer;
-  typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
+  typedef __rebind_pointer_t<_AllocPtr, const _Mv>
                                                  __const_map_value_type_pointer;
 };
 
@@ -689,9 +689,9 @@ public:
   typedef _NodePtr                                              __node_pointer;
 
   typedef _Tp                                                 __node_value_type;
-  typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, __node_value_type>
                                                       __node_value_type_pointer;
-  typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
+  typedef __rebind_pointer_t<_VoidPtr, const __node_value_type>
                                                 __const_node_value_type_pointer;
 #if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
   typedef typename __base::__end_node_pointer __iter_pointer;
@@ -704,13 +704,13 @@ public:
 private:
     static_assert(!is_const<__node_type>::value,
                 "_NodePtr should never be a pointer to const");
-    static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
+    static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>,
                           _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
 };
 
 template <class _ValueTp, class _VoidPtr>
 struct __make_tree_node_types {
-  typedef typename __rebind_pointer<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >::type
+  typedef __rebind_pointer_t<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >
                                                                         _NodePtr;
   typedef __tree_node_types<_NodePtr> type;
 };
@@ -1277,14 +1277,14 @@ public:
     }
 
     template <class _Vp,
-              class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
+              class = __enable_if_t<!is_same<__remove_const_ref_t<_Vp>, __container_value_type>::value> >
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(_Vp&& __v) {
         return __emplace_unique(_VSTD::forward<_Vp>(__v));
     }
 
     template <class _Vp,
-              class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
+              class = __enable_if_t<!is_same<__remove_const_ref_t<_Vp>, __container_value_type>::value> >
     _LIBCPP_INLINE_VISIBILITY
     iterator __insert_unique(const_iterator __p, _Vp&& __v) {
         return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v));

diff  --git a/libcxx/include/__tuple/apply_cv.h b/libcxx/include/__tuple/apply_cv.h
index 91969009f6bbb..296755a1d52dd 100644
--- a/libcxx/include/__tuple/apply_cv.h
+++ b/libcxx/include/__tuple/apply_cv.h
@@ -57,7 +57,7 @@ template <>
 struct __apply_cv_mf<true, true, true> {
   template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&;
 };
-template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type>
+template <class _Tp, class _RawTp = __libcpp_remove_reference_t<_Tp> >
 using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf<
     is_lvalue_reference<_Tp>::value,
     is_const<_RawTp>::value,

diff  --git a/libcxx/include/__tuple/make_tuple_types.h b/libcxx/include/__tuple/make_tuple_types.h
index 0827b2d504d92..38e2547d13dcf 100644
--- a/libcxx/include/__tuple/make_tuple_types.h
+++ b/libcxx/include/__tuple/make_tuple_types.h
@@ -56,13 +56,13 @@ struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
     >;
 };
 
-template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value,
+template <class _Tp, size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
           size_t _Sp = 0,
-          bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)>
+          bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
 struct __make_tuple_types
 {
     static_assert(_Sp <= _Ep, "__make_tuple_types input error");
-    using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type;
+    using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
     using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
     using type = typename _Maker::template __apply_quals<_Tp>;
 };

diff  --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h
index ce2fe7c3caf3c..ef3967015b80c 100644
--- a/libcxx/include/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__tuple/sfinae_helpers.h
@@ -58,7 +58,7 @@ struct __tuple_sfinae_base {
 
 // __tuple_convertible
 
-template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
+template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
                                 bool = __tuple_like<_Up>::value>
 struct __tuple_convertible
     : public false_type {};
@@ -73,7 +73,7 @@ struct __tuple_convertible<_Tp, _Up, true, true>
 
 // __tuple_constructible
 
-template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
+template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
                                 bool = __tuple_like<_Up>::value>
 struct __tuple_constructible
     : public false_type {};
@@ -88,7 +88,7 @@ struct __tuple_constructible<_Tp, _Up, true, true>
 
 // __tuple_assignable
 
-template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
+template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
                                 bool = __tuple_like<_Up>::value>
 struct __tuple_assignable
     : public false_type {};
@@ -115,7 +115,7 @@ template <class _SizeTrait, size_t _Expected>
 struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
     : integral_constant<bool, _SizeTrait::value == _Expected> {};
 
-template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __uncvref_t<_Tuple> >
+template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __libcpp_remove_reference_t<_Tuple> >
 using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp<
                                    __tuple_like<_RawTuple>::value,
                                    tuple_size<_RawTuple>, _ExpectedSize

diff  --git a/libcxx/include/__type_traits/add_lvalue_reference.h b/libcxx/include/__type_traits/add_lvalue_reference.h
index 9126caa9c7e93..daa5cb9e7dff1 100644
--- a/libcxx/include/__type_traits/add_lvalue_reference.h
+++ b/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -19,23 +19,33 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__add_lvalue_reference)
+
 template <class _Tp>
-struct add_lvalue_reference {
-  using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp);
-};
+using __add_lvalue_reference_t = __add_lvalue_reference(_Tp);
+
 #else
+
 template <class _Tp, bool = __libcpp_is_referenceable<_Tp>::value>
 struct __add_lvalue_reference_impl {
   typedef _LIBCPP_NODEBUG _Tp type;
 };
-template <class _Tp                                       > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; };
+template <class _Tp >
+struct __add_lvalue_reference_impl<_Tp, true> {
+  typedef _LIBCPP_NODEBUG _Tp& type;
+};
+
+template <class _Tp>
+using __add_lvalue_reference_t = typename __add_lvalue_reference_impl<_Tp>::type;
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference
-{typedef _LIBCPP_NODEBUG typename  __add_lvalue_reference_impl<_Tp>::type type;};
 #endif // __has_builtin(__add_lvalue_reference)
 
+template <class _Tp>
+struct add_lvalue_reference {
+  using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
+};
+
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
+template <class _Tp> using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/add_pointer.h b/libcxx/include/__type_traits/add_pointer.h
index be3f758da4afe..9d0c2010077bd 100644
--- a/libcxx/include/__type_traits/add_pointer.h
+++ b/libcxx/include/__type_traits/add_pointer.h
@@ -12,6 +12,7 @@
 #include <__config>
 #include <__type_traits/is_referenceable.h>
 #include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_reference.h>
 
@@ -22,25 +23,31 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__add_pointer)
+
 template <class _Tp>
-struct add_pointer {
-  using type _LIBCPP_NODEBUG = __add_pointer(_Tp);
-};
+using __add_pointer_t = __add_pointer(_Tp);
+
 #else
 template <class _Tp,
-          bool = __libcpp_is_referenceable<_Tp>::value || _IsSame<typename remove_cv<_Tp>::type, void>::value>
+          bool = __libcpp_is_referenceable<_Tp>::value || is_void<_Tp>::value>
 struct __add_pointer_impl {
-  typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;
+  typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp>* type;
 };
 template <class _Tp> struct __add_pointer_impl<_Tp, false>
     {typedef _LIBCPP_NODEBUG _Tp type;};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer
-    {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;};
+template <class _Tp>
+using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
+
 #endif // __has_builtin(__add_pointer)
 
+template <class _Tp>
+struct add_pointer {
+  using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
+};
+
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
+template <class _Tp> using add_pointer_t = __add_pointer_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/add_rvalue_reference.h b/libcxx/include/__type_traits/add_rvalue_reference.h
index be01d4ec5ba84..098e84c0722c5 100644
--- a/libcxx/include/__type_traits/add_rvalue_reference.h
+++ b/libcxx/include/__type_traits/add_rvalue_reference.h
@@ -19,23 +19,34 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__add_rvalue_reference)
+
 template <class _Tp>
-struct add_rvalue_reference {
-  using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp);
-};
+using __add_rvalue_reference_t = __add_rvalue_reference(_Tp);
+
 #else
+
 template <class _Tp, bool = __libcpp_is_referenceable<_Tp>::value>
 struct __add_rvalue_reference_impl {
   typedef _LIBCPP_NODEBUG _Tp type;
 };
-template <class _Tp                                       > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; };
+template <class _Tp >
+struct __add_rvalue_reference_impl<_Tp, true> {
+  typedef _LIBCPP_NODEBUG _Tp&& type;
+};
+
+template <class _Tp>
+using __add_rvalue_reference_t = typename __add_rvalue_reference_impl<_Tp>::type;
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
-{typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;};
 #endif // __has_builtin(__add_rvalue_reference)
 
+template <class _Tp>
+struct add_rvalue_reference {
+  using type = __add_rvalue_reference_t<_Tp>;
+};
+
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
+template <class _Tp>
+using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/apply_cv.h b/libcxx/include/__type_traits/apply_cv.h
index 766fb799ccddb..680ff6ac7d91a 100644
--- a/libcxx/include/__type_traits/apply_cv.h
+++ b/libcxx/include/__type_traits/apply_cv.h
@@ -21,8 +21,8 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value,
-                             bool = is_volatile<typename remove_reference<_Tp>::type>::value>
+template <class _Tp, class _Up, bool = is_const<__libcpp_remove_reference_t<_Tp> >::value,
+                             bool = is_volatile<__libcpp_remove_reference_t<_Tp> >::value>
 struct __apply_cv
 {
     typedef _LIBCPP_NODEBUG _Up type;

diff  --git a/libcxx/include/__type_traits/can_extract_key.h b/libcxx/include/__type_traits/can_extract_key.h
index ab9bcc54e06b2..72ac1ea15233c 100644
--- a/libcxx/include/__type_traits/can_extract_key.h
+++ b/libcxx/include/__type_traits/can_extract_key.h
@@ -29,21 +29,21 @@ struct __extract_key_self_tag {};
 struct __extract_key_first_tag {};
 
 template <class _ValTy, class _Key,
-          class _RawValTy = typename __unconstref<_ValTy>::type>
+          class _RawValTy = __remove_const_ref_t<_ValTy> >
 struct __can_extract_key
     : conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag,
                   __extract_key_fail_tag>::type {};
 
 template <class _Pair, class _Key, class _First, class _Second>
 struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
-    : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
+    : conditional<_IsSame<__remove_const_t<_First>, _Key>::value,
                   __extract_key_first_tag, __extract_key_fail_tag>::type {};
 
 // __can_extract_map_key uses true_type/false_type instead of the tags.
 // It returns true if _Key != _ContainerValueTy (the container is a map not a set)
 // and _ValTy == _Key.
 template <class _ValTy, class _Key, class _ContainerValueTy,
-          class _RawValTy = typename __unconstref<_ValTy>::type>
+          class _RawValTy = __remove_const_ref_t<_ValTy> >
 struct __can_extract_map_key
     : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
 

diff  --git a/libcxx/include/__type_traits/copy_cvref.h b/libcxx/include/__type_traits/copy_cvref.h
index 69b97ac1cb17b..8ec59b95a0ada 100644
--- a/libcxx/include/__type_traits/copy_cvref.h
+++ b/libcxx/include/__type_traits/copy_cvref.h
@@ -29,13 +29,13 @@ struct __copy_cvref
 template <class _From, class _To>
 struct __copy_cvref<_From&, _To>
 {
-    using type = typename add_lvalue_reference<__copy_cv_t<_From, _To> >::type;
+    using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
 };
 
 template <class _From, class _To>
 struct __copy_cvref<_From&&, _To>
 {
-    using type = typename add_rvalue_reference<__copy_cv_t<_From, _To> >::type;
+    using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
 };
 
 template <class _From, class _To>

diff  --git a/libcxx/include/__type_traits/decay.h b/libcxx/include/__type_traits/decay.h
index f4c2e34260c7c..c38bbdeff21b0 100644
--- a/libcxx/include/__type_traits/decay.h
+++ b/libcxx/include/__type_traits/decay.h
@@ -33,7 +33,7 @@ struct decay {
 #else
 template <class _Up, bool>
 struct __decay {
-    typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type;
+    typedef _LIBCPP_NODEBUG __remove_cv_t<_Up> type;
 };
 
 template <class _Up>
@@ -42,12 +42,12 @@ struct __decay<_Up, true> {
     typedef _LIBCPP_NODEBUG typename conditional
                      <
                          is_array<_Up>::value,
-                         typename remove_extent<_Up>::type*,
+                         __remove_extent_t<_Up>*,
                          typename conditional
                          <
                               is_function<_Up>::value,
                               typename add_pointer<_Up>::type,
-                              typename remove_cv<_Up>::type
+                              __remove_cv_t<_Up>
                          >::type
                      >::type type;
 };
@@ -56,7 +56,7 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS decay
 {
 private:
-    typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
+    typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
 public:
   typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type;
 };

diff  --git a/libcxx/include/__type_traits/is_convertible.h b/libcxx/include/__type_traits/is_convertible.h
index 7e49cd4e6a31b..1085d632a51b4 100644
--- a/libcxx/include/__type_traits/is_convertible.h
+++ b/libcxx/include/__type_traits/is_convertible.h
@@ -53,7 +53,7 @@ template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true>
 }
 
 template <class _Tp,
-    unsigned = __is_convertible_imp::__is_array_function_or_void<typename remove_reference<_Tp>::type>::value>
+    unsigned = __is_convertible_imp::__is_array_function_or_void<__libcpp_remove_reference_t<_Tp> >::value>
 struct __is_convertible_check
 {
     static const size_t __v = 0;

diff  --git a/libcxx/include/__type_traits/is_copy_assignable.h b/libcxx/include/__type_traits/is_copy_assignable.h
index c489af6511c4a..b3a965ff37262 100644
--- a/libcxx/include/__type_traits/is_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_copy_assignable.h
@@ -24,8 +24,8 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
     : public integral_constant<
           bool,
-          __is_assignable(typename add_lvalue_reference<_Tp>::type,
-                          typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
+          __is_assignable(__add_lvalue_reference_t<_Tp>,
+                          __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_copy_constructible.h b/libcxx/include/__type_traits/is_copy_constructible.h
index 93e60c4fcabf4..053e15911b91d 100644
--- a/libcxx/include/__type_traits/is_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_copy_constructible.h
@@ -24,7 +24,7 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
     : public integral_constant<
           bool,
-          __is_constructible(_Tp, typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
+          __is_constructible(_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_destructible.h b/libcxx/include/__type_traits/is_destructible.h
index 5e9ac5579fdd4..e0a0d3c1f19a2 100644
--- a/libcxx/include/__type_traits/is_destructible.h
+++ b/libcxx/include/__type_traits/is_destructible.h
@@ -63,7 +63,7 @@ struct __destructible_imp;
 template <class _Tp>
 struct __destructible_imp<_Tp, false>
    : public integral_constant<bool,
-        __is_destructor_wellformed<typename remove_all_extents<_Tp>::type>::value> {};
+        __is_destructor_wellformed<__remove_all_extents_t<_Tp> >::value> {};
 
 template <class _Tp>
 struct __destructible_imp<_Tp, true>

diff  --git a/libcxx/include/__type_traits/is_floating_point.h b/libcxx/include/__type_traits/is_floating_point.h
index d93e5d99d07b8..392844814b621 100644
--- a/libcxx/include/__type_traits/is_floating_point.h
+++ b/libcxx/include/__type_traits/is_floating_point.h
@@ -25,7 +25,7 @@ template <>          struct __libcpp_is_floating_point<double>      : public tru
 template <>          struct __libcpp_is_floating_point<long double> : public true_type {};
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
-    : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
+    : public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_integral.h b/libcxx/include/__type_traits/is_integral.h
index c1c573a75e0a0..4dcc1918e337c 100644
--- a/libcxx/include/__type_traits/is_integral.h
+++ b/libcxx/include/__type_traits/is_integral.h
@@ -58,7 +58,7 @@ inline constexpr bool is_integral_v = __is_integral(_Tp);
 #else
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
-    : public _BoolConstant<__libcpp_is_integral<typename remove_cv<_Tp>::type>::value> {};
+    : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_member_function_pointer.h b/libcxx/include/__type_traits/is_member_function_pointer.h
index 2d2ff81e091a7..c28f359d72e31 100644
--- a/libcxx/include/__type_traits/is_member_function_pointer.h
+++ b/libcxx/include/__type_traits/is_member_function_pointer.h
@@ -50,7 +50,7 @@ inline constexpr bool is_member_function_pointer_v = __is_member_function_pointe
 #else // __has_builtin(__is_member_function_pointer)
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
-    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_func > {};
+    : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func > {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_member_object_pointer.h b/libcxx/include/__type_traits/is_member_object_pointer.h
index 250a22c974406..5bab14b4bf561 100644
--- a/libcxx/include/__type_traits/is_member_object_pointer.h
+++ b/libcxx/include/__type_traits/is_member_object_pointer.h
@@ -32,7 +32,7 @@ inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_T
 #else // __has_builtin(__is_member_object_pointer)
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
-    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_obj >  {};
+    : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj >  {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_member_pointer.h b/libcxx/include/__type_traits/is_member_pointer.h
index 448bcc23d55ed..8b4aff8563e9e 100644
--- a/libcxx/include/__type_traits/is_member_pointer.h
+++ b/libcxx/include/__type_traits/is_member_pointer.h
@@ -31,7 +31,7 @@ inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
 #else // __has_builtin(__is_member_pointer)
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
- : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_member > {};
+ : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_move_assignable.h b/libcxx/include/__type_traits/is_move_assignable.h
index 2953e0ab581fd..3c7158b2ae06c 100644
--- a/libcxx/include/__type_traits/is_move_assignable.h
+++ b/libcxx/include/__type_traits/is_move_assignable.h
@@ -24,7 +24,7 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_move_assignable
     : public integral_constant<
           bool,
-          __is_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {};
+          __is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_move_constructible.h b/libcxx/include/__type_traits/is_move_constructible.h
index 6a1148e5e1bad..667d10494fff4 100644
--- a/libcxx/include/__type_traits/is_move_constructible.h
+++ b/libcxx/include/__type_traits/is_move_constructible.h
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_move_constructible
-    : public integral_constant<bool, __is_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)>
+    : public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
     {};
 
 #if _LIBCPP_STD_VER > 14

diff  --git a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
index f9a947488180a..58f7d97a55780 100644
--- a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
@@ -25,8 +25,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
     : public integral_constant<
           bool,
           __is_nothrow_assignable(
-              typename add_lvalue_reference<_Tp>::type,
-              typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
+              __add_lvalue_reference_t<_Tp>,
+              __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
index 5f31da54a0bb9..ce17334b3f819 100644
--- a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
@@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
     : public is_nothrow_constructible<_Tp,
-                  typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
+                  __add_lvalue_reference_t<typename add_const<_Tp>::type> > {};
 
 #else // _LIBCPP_COMPILER_GCC
 

diff  --git a/libcxx/include/__type_traits/is_nothrow_destructible.h b/libcxx/include/__type_traits/is_nothrow_destructible.h
index 8df29c189e74b..050362f9f4286 100644
--- a/libcxx/include/__type_traits/is_nothrow_destructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_destructible.h
@@ -71,7 +71,7 @@ template <class _Tp> struct __libcpp_nothrow_destructor
                                      is_reference<_Tp>::value> {};
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
-    : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
+    : public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > {};
 
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>

diff  --git a/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/libcxx/include/__type_traits/is_nothrow_move_assignable.h
index daf22695b5bf5..18dcc9b232c6d 100644
--- a/libcxx/include/__type_traits/is_nothrow_move_assignable.h
+++ b/libcxx/include/__type_traits/is_nothrow_move_assignable.h
@@ -24,7 +24,7 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
     : public integral_constant<
           bool,
-          __is_nothrow_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {
+          __is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
 };
 
 #if _LIBCPP_STD_VER > 14

diff  --git a/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/libcxx/include/__type_traits/is_nothrow_move_constructible.h
index 84c2a45e9349c..ad8222a0e4c07 100644
--- a/libcxx/include/__type_traits/is_nothrow_move_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_move_constructible.h
@@ -24,13 +24,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 #ifndef _LIBCPP_COMPILER_GCC
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
-    : public integral_constant<bool, __is_nothrow_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)>
+    : public integral_constant<bool, __is_nothrow_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
     {};
 
 #else // _LIBCPP_COMPILER_GCC
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
-    : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
+    : public is_nothrow_constructible<_Tp, __add_rvalue_reference_t<_Tp> >
     {};
 
 #endif // _LIBCPP_COMPILER_GCC

diff  --git a/libcxx/include/__type_traits/is_null_pointer.h b/libcxx/include/__type_traits/is_null_pointer.h
index f81cb9aadb2f1..4864cee11a106 100644
--- a/libcxx/include/__type_traits/is_null_pointer.h
+++ b/libcxx/include/__type_traits/is_null_pointer.h
@@ -24,11 +24,11 @@ template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
 template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
-    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
+    : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
 
 #if _LIBCPP_STD_VER > 11
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
-    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
+    : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_pointer.h b/libcxx/include/__type_traits/is_pointer.h
index 63c82ae4715cf..3c0ad04892a25 100644
--- a/libcxx/include/__type_traits/is_pointer.h
+++ b/libcxx/include/__type_traits/is_pointer.h
@@ -43,7 +43,7 @@ template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretai
 #endif
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
-    : public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {};
+    : public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<__remove_cv_t<_Tp> >::type> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_reference_wrapper.h b/libcxx/include/__type_traits/is_reference_wrapper.h
index cd391bb07e78d..d187eec1e1320 100644
--- a/libcxx/include/__type_traits/is_reference_wrapper.h
+++ b/libcxx/include/__type_traits/is_reference_wrapper.h
@@ -24,7 +24,7 @@ template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
 template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
 template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
 template <class _Tp> struct __is_reference_wrapper
-    : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
+    : public __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {};
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__type_traits/is_swappable.h b/libcxx/include/__type_traits/is_swappable.h
index b09bda12823ab..8db7daa970155 100644
--- a/libcxx/include/__type_traits/is_swappable.h
+++ b/libcxx/include/__type_traits/is_swappable.h
@@ -121,8 +121,8 @@ struct _LIBCPP_TEMPLATE_VIS is_swappable
     : public conditional<
         __libcpp_is_referenceable<_Tp>::value,
         is_swappable_with<
-            typename add_lvalue_reference<_Tp>::type,
-            typename add_lvalue_reference<_Tp>::type>,
+            __add_lvalue_reference_t<_Tp>,
+            __add_lvalue_reference_t<_Tp> >,
         false_type
     >::type
 {
@@ -139,8 +139,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable
     : public conditional<
         __libcpp_is_referenceable<_Tp>::value,
         is_nothrow_swappable_with<
-            typename add_lvalue_reference<_Tp>::type,
-            typename add_lvalue_reference<_Tp>::type>,
+            __add_lvalue_reference_t<_Tp>,
+            __add_lvalue_reference_t<_Tp> >,
         false_type
     >::type
 {

diff  --git a/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/libcxx/include/__type_traits/is_trivially_copy_assignable.h
index 820e4c12c783b..e6a4a35dbfb36 100644
--- a/libcxx/include/__type_traits/is_trivially_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_copy_assignable.h
@@ -25,8 +25,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
     : public integral_constant<
           bool,
           __is_trivially_assignable(
-              typename add_lvalue_reference<_Tp>::type,
-              typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
+              __add_lvalue_reference_t<_Tp>,
+              __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/libcxx/include/__type_traits/is_trivially_copy_constructible.h
index daa66cd4554d7..4bbb803a55cf5 100644
--- a/libcxx/include/__type_traits/is_trivially_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_copy_constructible.h
@@ -20,7 +20,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
-    : public integral_constant<bool, __is_trivially_constructible(_Tp, typename add_lvalue_reference<const _Tp>::type)>
+    : public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)>
     {};
 
 #if _LIBCPP_STD_VER > 14

diff  --git a/libcxx/include/__type_traits/is_trivially_move_assignable.h b/libcxx/include/__type_traits/is_trivially_move_assignable.h
index d4839ea9bdbb9..8f8876f45aad0 100644
--- a/libcxx/include/__type_traits/is_trivially_move_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_move_assignable.h
@@ -24,8 +24,7 @@ template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
     : public integral_constant<
           bool,
-          __is_trivially_assignable(
-              typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {};
+          __is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_trivially_move_constructible.h b/libcxx/include/__type_traits/is_trivially_move_constructible.h
index b9ee637606796..151bb256b95b9 100644
--- a/libcxx/include/__type_traits/is_trivially_move_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_move_constructible.h
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
-    : public integral_constant<bool, __is_trivially_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)> {};
+    : public integral_constant<bool, __is_trivially_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/is_void.h b/libcxx/include/__type_traits/is_void.h
index 4cebf18633b20..1c7ad83f939df 100644
--- a/libcxx/include/__type_traits/is_void.h
+++ b/libcxx/include/__type_traits/is_void.h
@@ -31,7 +31,7 @@ inline constexpr bool is_void_v = __is_void(_Tp);
 #else
 
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
-    : public is_same<typename remove_cv<_Tp>::type, void> {};
+    : public is_same<__remove_cv_t<_Tp>, void> {};
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>

diff  --git a/libcxx/include/__type_traits/make_const_lvalue_ref.h b/libcxx/include/__type_traits/make_const_lvalue_ref.h
index 831305f2d3aa1..deea40d5e61a1 100644
--- a/libcxx/include/__type_traits/make_const_lvalue_ref.h
+++ b/libcxx/include/__type_traits/make_const_lvalue_ref.h
@@ -19,7 +19,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template<class _Tp>
-using __make_const_lvalue_ref = const typename remove_reference<_Tp>::type&;
+using __make_const_lvalue_ref = const __libcpp_remove_reference_t<_Tp>&;
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__type_traits/make_signed.h b/libcxx/include/__type_traits/make_signed.h
index c36e2292f16f5..bff8744845fa9 100644
--- a/libcxx/include/__type_traits/make_signed.h
+++ b/libcxx/include/__type_traits/make_signed.h
@@ -24,10 +24,10 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__make_signed)
+
 template <class _Tp>
-struct make_signed {
-  using type _LIBCPP_NODEBUG = __make_signed(_Tp);
-};
+using __make_signed_t = __make_signed(_Tp);
+
 #else
 typedef
     __type_list<signed char,
@@ -68,14 +68,17 @@ template <> struct __make_signed<__uint128_t,        true> {typedef __int128_t t
 #  endif
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS make_signed
-{
-    typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
-};
+using __make_signed_t = typename __apply_cv<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>::type;
+
 #endif // __has_builtin(__make_signed)
 
+template <class _Tp>
+struct make_signed {
+  using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>;
+};
+
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
+template <class _Tp> using make_signed_t = __make_signed_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/make_unsigned.h b/libcxx/include/__type_traits/make_unsigned.h
index 6d4e482a8d973..33c30147a6133 100644
--- a/libcxx/include/__type_traits/make_unsigned.h
+++ b/libcxx/include/__type_traits/make_unsigned.h
@@ -26,10 +26,10 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__make_unsigned)
+
 template <class _Tp>
-struct make_unsigned {
-  using type _LIBCPP_NODEBUG = __make_unsigned(_Tp);
-};
+using __make_unsigned_t = __make_unsigned(_Tp);
+
 #else
 typedef
     __type_list<unsigned char,
@@ -70,26 +70,29 @@ template <> struct __make_unsigned<__uint128_t,        true> {typedef __uint128_
 #  endif
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS make_unsigned
-{
-    typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
-};
+using __make_unsigned_t = typename __apply_cv<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>::type;
+
 #endif // __has_builtin(__make_unsigned)
 
+template <class _Tp>
+struct make_unsigned {
+  using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>;
+};
+
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
+template <class _Tp> using make_unsigned_t = __make_unsigned_t<_Tp>;
 #endif
 
 #ifndef _LIBCPP_CXX03_LANG
 template <class _Tp>
 _LIBCPP_HIDE_FROM_ABI constexpr
-typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
-    return static_cast<typename make_unsigned<_Tp>::type>(__x);
+__make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept {
+    return static_cast<__make_unsigned_t<_Tp> >(__x);
 }
 #endif
 
 template <class _Tp, class _Up>
-using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, typename make_unsigned<_Up>::type, _Up>;
+using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, __make_unsigned_t<_Up>, _Up>;
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__type_traits/remove_all_extents.h b/libcxx/include/__type_traits/remove_all_extents.h
index cc00a61c92b3b..868cf1039f6f7 100644
--- a/libcxx/include/__type_traits/remove_all_extents.h
+++ b/libcxx/include/__type_traits/remove_all_extents.h
@@ -23,6 +23,9 @@ template <class _Tp>
 struct remove_all_extents {
   using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp);
 };
+
+template <class _Tp>
+using __remove_all_extents_t = __remove_all_extents(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
     {typedef _Tp type;};
@@ -30,10 +33,13 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
     {typedef typename remove_all_extents<_Tp>::type type;};
 template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
     {typedef typename remove_all_extents<_Tp>::type type;};
+
+template <class _Tp>
+using __remove_all_extents_t = typename remove_all_extents<_Tp>::type;
 #endif // __has_builtin(__remove_all_extents)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
+template <class _Tp> using remove_all_extents_t = __remove_all_extents_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_const.h b/libcxx/include/__type_traits/remove_const.h
index 8eefbd099cb35..dc565338548e2 100644
--- a/libcxx/include/__type_traits/remove_const.h
+++ b/libcxx/include/__type_traits/remove_const.h
@@ -22,13 +22,19 @@ template <class _Tp>
 struct remove_const {
   using type _LIBCPP_NODEBUG = __remove_const(_Tp);
 };
+
+template <class _Tp>
+using __remove_const_t = __remove_const(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const            {typedef _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
+
+template <class _Tp>
+using __remove_const_t = typename remove_const<_Tp>::type;
 #endif // __has_builtin(__remove_const)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
+template <class _Tp> using remove_const_t = __remove_const_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_const_ref.h b/libcxx/include/__type_traits/remove_const_ref.h
index 2e3f5e4d41d41..d3b334935a5b1 100644
--- a/libcxx/include/__type_traits/remove_const_ref.h
+++ b/libcxx/include/__type_traits/remove_const_ref.h
@@ -20,9 +20,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct __unconstref {
-    typedef _LIBCPP_NODEBUG typename remove_const<typename remove_reference<_Tp>::type>::type type;
-};
+using __remove_const_ref_t = __remove_const_t<__libcpp_remove_reference_t<_Tp> >;
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__type_traits/remove_cv.h b/libcxx/include/__type_traits/remove_cv.h
index 9e3dee6c46ed7..ea85e23b80652 100644
--- a/libcxx/include/__type_traits/remove_cv.h
+++ b/libcxx/include/__type_traits/remove_cv.h
@@ -24,13 +24,19 @@ template <class _Tp>
 struct remove_cv {
   using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
 };
+
+template <class _Tp>
+using __remove_cv_t = __remove_cv(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
-{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
+{typedef __remove_volatile_t<__remove_const_t<_Tp> > type;};
+
+template <class _Tp>
+using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >;
 #endif // __has_builtin(__remove_cv)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
+template <class _Tp> using remove_cv_t = __remove_cv_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_cvref.h b/libcxx/include/__type_traits/remove_cvref.h
index 3af261db3949d..e96cc6523b71d 100644
--- a/libcxx/include/__type_traits/remove_cvref.h
+++ b/libcxx/include/__type_traits/remove_cvref.h
@@ -22,23 +22,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__remove_cvref)
 template <class _Tp>
-using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
+using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
 #else
 template <class _Tp>
-using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv<typename remove_reference<_Tp>::type>::type;
+using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
 #endif // __has_builtin(__remove_cvref)
 
 template <class _Tp, class _Up>
-struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {};
+struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {};
 
 #if _LIBCPP_STD_VER > 17
-// remove_cvref - same as __uncvref
 template <class _Tp>
 struct remove_cvref {
-    using type _LIBCPP_NODEBUG = __uncvref_t<_Tp>;
+    using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
 };
 
-template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type;
+template <class _Tp> using remove_cvref_t = __remove_cvref_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_extent.h b/libcxx/include/__type_traits/remove_extent.h
index 88da32a4e265d..79d6e573dddb8 100644
--- a/libcxx/include/__type_traits/remove_extent.h
+++ b/libcxx/include/__type_traits/remove_extent.h
@@ -23,6 +23,9 @@ template <class _Tp>
 struct remove_extent {
   using type _LIBCPP_NODEBUG = __remove_extent(_Tp);
 };
+
+template <class _Tp>
+using __remove_extent_t = __remove_extent(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
     {typedef _Tp type;};
@@ -30,10 +33,13 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
     {typedef _Tp type;};
 template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
     {typedef _Tp type;};
+
+template <class _Tp>
+using __remove_extent_t = typename remove_extent<_Tp>::type;
 #endif // __has_builtin(__remove_extent)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type;
+template <class _Tp> using remove_extent_t = __remove_extent_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h
index 9042a52500552..33ddb7103f0dd 100644
--- a/libcxx/include/__type_traits/remove_pointer.h
+++ b/libcxx/include/__type_traits/remove_pointer.h
@@ -22,16 +22,22 @@ template <class _Tp>
 struct remove_pointer {
   using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
 };
+
+template <class _Tp>
+using __remove_pointer_t = __remove_pointer(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer                      {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*>                {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const>          {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile>       {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
+
+template <class _Tp>
+using __remove_pointer_t = typename remove_pointer<_Tp>::type;
 #endif // __has_builtin(__remove_pointer)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
+template <class _Tp> using remove_pointer_t = __remove_pointer_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_reference.h b/libcxx/include/__type_traits/remove_reference.h
index 023b36cbc2cf6..b9a69749b3b92 100644
--- a/libcxx/include/__type_traits/remove_reference.h
+++ b/libcxx/include/__type_traits/remove_reference.h
@@ -23,14 +23,20 @@ template <class _Tp>
 struct remove_reference {
   using type _LIBCPP_NODEBUG = __remove_reference_t(_Tp);
 };
+
+template <class _Tp>
+using __libcpp_remove_reference_t = __remove_reference_t(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&>  {typedef _LIBCPP_NODEBUG _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;};
+
+template <class _Tp>
+using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
 #endif // __has_builtin(__remove_reference_t)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type;
+template <class _Tp> using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__type_traits/remove_volatile.h b/libcxx/include/__type_traits/remove_volatile.h
index 8c7aa67441930..ed6d63b41744c 100644
--- a/libcxx/include/__type_traits/remove_volatile.h
+++ b/libcxx/include/__type_traits/remove_volatile.h
@@ -22,13 +22,19 @@ template <class _Tp>
 struct remove_volatile {
   using type _LIBCPP_NODEBUG = __remove_volatile(_Tp);
 };
+
+template <class _Tp>
+using __remove_volatile_t = __remove_volatile(_Tp);
 #else
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile               {typedef _Tp type;};
 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
+
+template <class _Tp>
+using __remove_volatile_t = typename remove_volatile<_Tp>::type;
 #endif // __has_builtin(__remove_volatile)
 
 #if _LIBCPP_STD_VER > 11
-template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
+template <class _Tp> using remove_volatile_t = __remove_volatile_t<_Tp>;
 #endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/__utility/forward.h b/libcxx/include/__utility/forward.h
index 03ca16d9f9553..4e254e0fa0e87 100644
--- a/libcxx/include/__utility/forward.h
+++ b/libcxx/include/__utility/forward.h
@@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
-forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT {
+forward(__libcpp_remove_reference_t<_Tp>& __t) _NOEXCEPT {
   return static_cast<_Tp&&>(__t);
 }
 
 template <class _Tp>
 _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
-forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT {
+forward(__libcpp_remove_reference_t<_Tp>&& __t) _NOEXCEPT {
   static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue");
   return static_cast<_Tp&&>(__t);
 }

diff  --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h
index 7a4973fa04076..bedd9e1e008e1 100644
--- a/libcxx/include/__utility/in_place.h
+++ b/libcxx/include/__utility/in_place.h
@@ -43,13 +43,13 @@ template <class _Tp> struct __is_inplace_type_imp : false_type {};
 template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
 
 template <class _Tp>
-using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
+using __is_inplace_type = __is_inplace_type_imp<__remove_cvref_t<_Tp>>;
 
 template <class _Tp> struct __is_inplace_index_imp : false_type {};
 template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
 
 template <class _Tp>
-using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>;
+using __is_inplace_index = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
 
 #endif // _LIBCPP_STD_VER > 14
 

diff  --git a/libcxx/include/__utility/move.h b/libcxx/include/__utility/move.h
index cfd245ad1059d..8fe6af2ef358f 100644
--- a/libcxx/include/__utility/move.h
+++ b/libcxx/include/__utility/move.h
@@ -20,9 +20,9 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&&
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __libcpp_remove_reference_t<_Tp>&&
 move(_Tp&& __t) _NOEXCEPT {
-  typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
+  typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
   return static_cast<_Up&&>(__t);
 }
 

diff  --git a/libcxx/include/any b/libcxx/include/any
index 527af769c8c6f..8a3e34b94a99d 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -605,7 +605,7 @@ inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any const & __v)
 {
-    using _RawValueType = __uncvref_t<_ValueType>;
+    using _RawValueType = __remove_cvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
                   "ValueType is required to be a const lvalue reference "
                   "or a CopyConstructible type");
@@ -620,7 +620,7 @@ inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any & __v)
 {
-    using _RawValueType = __uncvref_t<_ValueType>;
+    using _RawValueType = __remove_cvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType &>::value,
                   "ValueType is required to be an lvalue reference "
                   "or a CopyConstructible type");
@@ -635,7 +635,7 @@ inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any && __v)
 {
-    using _RawValueType = __uncvref_t<_ValueType>;
+    using _RawValueType = __remove_cvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType>::value,
                   "ValueType is required to be an rvalue reference "
                   "or a CopyConstructible type");
@@ -675,7 +675,7 @@ any_cast(any * __any) _NOEXCEPT
     using __any_imp::_Action;
     static_assert(!is_reference<_ValueType>::value,
                   "_ValueType may not be a reference.");
-    typedef typename add_pointer<_ValueType>::type _ReturnType;
+    typedef add_pointer_t<_ValueType> _ReturnType;
     if (__any && __any->__h_) {
       void *__p = __any->__call(_Action::_Get, nullptr,
 #if !defined(_LIBCPP_NO_RTTI)

diff  --git a/libcxx/include/atomic b/libcxx/include/atomic
index 571e34be60ce0..1c27fa804e419 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -944,13 +944,13 @@ void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_ord
 template<class _Tp>
 _LIBCPP_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
-    using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
+    using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
     return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
 _LIBCPP_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
-    using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
+    using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
     return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
 }
 
@@ -1802,28 +1802,28 @@ struct atomic<_Tp*>
     _LIBCPP_INLINE_VISIBILITY
     _Tp* fetch_add(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
-        static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
+        static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
     }
 
     _LIBCPP_INLINE_VISIBILITY
     _Tp* fetch_add(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
-        static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
+        static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
     }
 
     _LIBCPP_INLINE_VISIBILITY
     _Tp* fetch_sub(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
-        static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
+        static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
     }
 
     _LIBCPP_INLINE_VISIBILITY
     _Tp* fetch_sub(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
-        static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
+        static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
     }
 

diff  --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine
index 55062d4887bc6..ae4fbd9c99f6e 100644
--- a/libcxx/include/experimental/coroutine
+++ b/libcxx/include/experimental/coroutine
@@ -259,7 +259,7 @@ public:
 
     _LIBCPP_INLINE_VISIBILITY
     static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT {
-        typedef typename remove_cv<_Promise>::type _RawPromise;
+        typedef __remove_cv_t<_Promise> _RawPromise;
         coroutine_handle __tmp;
         __tmp.__handle_ = __builtin_coro_promise(
             _VSTD::addressof(const_cast<_RawPromise&>(__promise)),

diff  --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional
index 873973d8acb09..39281bd5771d3 100644
--- a/libcxx/include/experimental/functional
+++ b/libcxx/include/experimental/functional
@@ -161,7 +161,7 @@ private:
     typedef _Value value_type;
     typedef _Key   key_type;
 
-    typedef typename make_unsigned<key_type>::type unsigned_key_type;
+    typedef __make_unsigned_t<key_type> unsigned_key_type;
     typedef std::array<value_type, 256> skip_map;
     skip_map __table_;
 

diff  --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index 4a7b7410cb346..3f46205975c2f 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -145,9 +145,9 @@ public:
       "Instantiation of propagate_const with an array type is ill-formed.");
   static_assert(!is_reference<_Tp>::value,
       "Instantiation of propagate_const with a reference type is ill-formed.");
-  static_assert(!(is_pointer<_Tp>::value && is_function<typename remove_pointer<_Tp>::type>::value),
+  static_assert(!(is_pointer<_Tp>::value && is_function<__remove_pointer_t<_Tp> >::value),
       "Instantiation of propagate_const with a function-pointer type is ill-formed.");
-  static_assert(!(is_pointer<_Tp>::value && is_same<typename remove_cv<typename remove_pointer<_Tp>::type>::type, void>::value),
+  static_assert(!(is_pointer<_Tp>::value && is_same<__remove_cv_t<__remove_pointer_t<_Tp> >, void>::value),
       "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
 
 private:

diff  --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd
index 4a52358ce144f..00585689152ca 100644
--- a/libcxx/include/experimental/simd
+++ b/libcxx/include/experimental/simd
@@ -1057,7 +1057,7 @@ struct simd_size<_Tp, __simd_abi<__kind, _Np>>
     : std::integral_constant<size_t, _Np> {
   static_assert(
       std::is_arithmetic<_Tp>::value &&
-          !std::is_same<typename std::remove_const<_Tp>::type, bool>::value,
+          !std::is_same<__remove_const_t<_Tp>, bool>::value,
       "Element type should be vectorizable");
 };
 
@@ -1299,7 +1299,7 @@ class const_where_expression {
 public:
   const_where_expression(const const_where_expression&) = delete;
   const_where_expression& operator=(const const_where_expression&) = delete;
-  typename remove_const<_Tp>::type operator-() const&&;
+  __remove_const_t<_Tp> operator-() const&&;
   template <class _Up, class _Flags>
   void copy_to(_Up*, _Flags) const&&;
 };
@@ -1366,8 +1366,8 @@ private:
             __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) ||
            (!std::is_arithmetic<_Up>::value &&
             std::is_convertible<_Up, _Tp>::value) ||
-           std::is_same<typename std::remove_const<_Up>::type, int>::value ||
-           (std::is_same<typename std::remove_const<_Up>::type,
+           std::is_same<__remove_const_t<_Up>, int>::value ||
+           (std::is_same<__remove_const_t<_Up>,
                          unsigned int>::value &&
             std::is_unsigned<_Tp>::value);
   }

diff  --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index b7830e848a6aa..e4b61416f71c0 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -378,7 +378,7 @@ public:
     typedef std::pair<key_type, mapped_type>                     value_type;
     typedef typename _HashIterator::
diff erence_type              
diff erence_type;
     typedef value_type&                                          reference;
-    typedef typename std::__rebind_pointer<typename _HashIterator::pointer, value_type>::type
+    typedef std::__rebind_pointer_t<typename _HashIterator::pointer, value_type>
         pointer;
 
     _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
@@ -423,7 +423,7 @@ public:
     typedef std::pair<key_type, mapped_type>                     value_type;
     typedef typename _HashIterator::
diff erence_type              
diff erence_type;
     typedef const value_type&                                    reference;
-    typedef typename std::__rebind_pointer<typename _HashIterator::pointer, const value_type>::type
+    typedef std::__rebind_pointer_t<typename _HashIterator::pointer, const value_type>
         pointer;
 
     _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}

diff  --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 4087992db68e3..4ef2fa0571291 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -241,14 +241,13 @@ struct __forward_list_node_value_type<__forward_list_node<_Tp, _VoidPtr> > {
 template <class _NodePtr>
 struct __forward_node_traits {
 
-  typedef typename remove_cv<
-        typename pointer_traits<_NodePtr>::element_type>::type  __node;
+  typedef __remove_cv_t<
+        typename pointer_traits<_NodePtr>::element_type>        __node;
   typedef typename __forward_list_node_value_type<__node>::type __node_value_type;
   typedef _NodePtr                                              __node_pointer;
   typedef __forward_begin_node<_NodePtr>                        __begin_node;
-  typedef typename __rebind_pointer<_NodePtr, __begin_node>::type
-                                                                __begin_node_pointer;
-  typedef typename __rebind_pointer<_NodePtr, void>::type       __void_pointer;
+  typedef __rebind_pointer_t<_NodePtr, __begin_node>            __begin_node_pointer;
+  typedef __rebind_pointer_t<_NodePtr, void>                    __void_pointer;
 
 #if defined(_LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB)
   typedef __begin_node_pointer __iter_node_pointer;
@@ -280,7 +279,7 @@ template <class _NodePtr>
 struct __forward_begin_node
 {
     typedef _NodePtr pointer;
-    typedef typename __rebind_pointer<_NodePtr, __forward_begin_node>::type __begin_node_pointer;
+    typedef __rebind_pointer_t<_NodePtr, __forward_begin_node> __begin_node_pointer;
 
     pointer __next_;
 
@@ -296,7 +295,7 @@ template <class _Tp, class _VoidPtr>
 struct _LIBCPP_HIDDEN __begin_node_of
 {
     typedef __forward_begin_node<
-        typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type
+        __rebind_pointer_t<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >
     > type;
 };
 
@@ -355,7 +354,7 @@ public:
     typedef value_type&                                       reference;
     typedef typename pointer_traits<__node_pointer>::
diff erence_type
                                                               
diff erence_type;
-    typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;
+    typedef __rebind_pointer_t<__node_pointer, value_type> pointer;
 
     _LIBCPP_INLINE_VISIBILITY
     __forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {}
@@ -436,7 +435,7 @@ public:
     typedef const value_type&                                 reference;
     typedef typename pointer_traits<__node_pointer>::
diff erence_type
                                                               
diff erence_type;
-    typedef typename __rebind_pointer<__node_pointer, const value_type>::type
+    typedef __rebind_pointer_t<__node_pointer, const value_type>
                                                               pointer;
 
     _LIBCPP_INLINE_VISIBILITY

diff  --git a/libcxx/include/future b/libcxx/include/future
index 1bc9a95465422..d4cf546d96cca 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -637,7 +637,7 @@ public:
     void set_value_at_thread_exit(_Arg&& __arg);
 
     _Rp move();
-    typename add_lvalue_reference<_Rp>::type copy();
+    __add_lvalue_reference_t<_Rp> copy();
 };
 
 template <class _Rp>
@@ -688,7 +688,7 @@ __assoc_state<_Rp>::move()
 }
 
 template <class _Rp>
-typename add_lvalue_reference<_Rp>::type
+__add_lvalue_reference_t<_Rp>
 __assoc_state<_Rp>::copy()
 {
     unique_lock<mutex> __lk(this->__mut_);
@@ -1750,7 +1750,7 @@ template <class _Fp>
 __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
     : __f_(nullptr)
 {
-    typedef typename remove_reference<typename decay<_Fp>::type>::type _FR;
+    typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
     typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
     if (sizeof(_FF) <= sizeof(__buf_))
     {
@@ -1774,7 +1774,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
                                   allocator_arg_t, const _Alloc& __a0, _Fp&& __f)
     : __f_(nullptr)
 {
-    typedef typename remove_reference<typename decay<_Fp>::type>::type _FR;
+    typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
     typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF;
     if (sizeof(_FF) <= sizeof(__buf_))
     {
@@ -1887,11 +1887,11 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     packaged_task() _NOEXCEPT : __p_(nullptr) {}
     template <class _Fp,
-              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
+              class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
         _LIBCPP_INLINE_VISIBILITY
         explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
     template <class _Fp, class _Allocator,
-              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
+              class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
         _LIBCPP_INLINE_VISIBILITY
         packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
              : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
@@ -2002,11 +2002,11 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     packaged_task() _NOEXCEPT : __p_(nullptr) {}
     template <class _Fp,
-              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
+              class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
         _LIBCPP_INLINE_VISIBILITY
         explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
     template <class _Fp, class _Allocator,
-              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
+              class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
         _LIBCPP_INLINE_VISIBILITY
         packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
              : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),

diff  --git a/libcxx/include/limits b/libcxx/include/limits
index 1fa3a8228fd8f..2e2883f44c0d7 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -451,9 +451,9 @@ protected:
 
 template <class _Tp>
 class _LIBCPP_TEMPLATE_VIS numeric_limits
-    : private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
+    : private __libcpp_numeric_limits<__remove_cv_t<_Tp> >
 {
-    typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
+    typedef __libcpp_numeric_limits<__remove_cv_t<_Tp> > __base;
     typedef typename __base::type type;
 public:
     static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;

diff  --git a/libcxx/include/list b/libcxx/include/list
index e5a6c3f4568fe..478fe505cc7b1 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -239,9 +239,9 @@ template <class _Tp, class _VoidPtr> struct __list_node_base;
 
 template <class _Tp, class _VoidPtr>
 struct __list_node_pointer_traits {
-  typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
+  typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> >
         __node_pointer;
-  typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type
+  typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >
         __base_pointer;
 
 #if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB)
@@ -342,7 +342,7 @@ public:
     typedef bidirectional_iterator_tag       iterator_category;
     typedef _Tp                              value_type;
     typedef value_type&                      reference;
-    typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer;
+    typedef __rebind_pointer_t<_VoidPtr, value_type> pointer;
     typedef typename pointer_traits<pointer>::
diff erence_type 
diff erence_type;
 
     _LIBCPP_INLINE_VISIBILITY
@@ -450,7 +450,7 @@ public:
     typedef bidirectional_iterator_tag       iterator_category;
     typedef _Tp                              value_type;
     typedef const value_type&                reference;
-    typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer;
+    typedef __rebind_pointer_t<_VoidPtr, const value_type> pointer;
     typedef typename pointer_traits<pointer>::
diff erence_type 
diff erence_type;
 
     _LIBCPP_INLINE_VISIBILITY

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index fec6c2f90977f..4aee7c66c91c8 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -753,11 +753,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
 {
     if (__a != __a_end)
     {
-        typename remove_reference<decltype(errno)>::type __save_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
         errno = 0;
         char *__p2;
         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
-        typename remove_reference<decltype(errno)>::type __current_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
         if (__p2 != __a_end)
@@ -793,11 +793,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
           __err = ios_base::failbit;
           return 0;
         }
-        typename remove_reference<decltype(errno)>::type __save_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
         errno = 0;
         char *__p2;
         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
-        typename remove_reference<decltype(errno)>::type __current_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
         if (__p2 != __a_end)
@@ -847,11 +847,11 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
 {
     if (__a != __a_end)
     {
-        typename remove_reference<decltype(errno)>::type __save_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
         errno = 0;
         char *__p2;
         _Tp __ld = __do_strtod<_Tp>(__a, &__p2);
-        typename remove_reference<decltype(errno)>::type __current_errno = errno;
+        __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
         if (__p2 != __a_end)

diff  --git a/libcxx/include/new b/libcxx/include/new
index 29c1d9e835011..825034c44ce1c 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -365,7 +365,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
 _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
 {
     static_assert (!(is_function<_Tp>::value), "can't launder functions" );
-    static_assert (!(is_same<void, typename remove_cv<_Tp>::type>::value), "can't launder cv-void" );
+    static_assert (!(is_same<void, __remove_cv_t<_Tp> >::value), "can't launder cv-void" );
     return __builtin_launder(__p);
 }
 

diff  --git a/libcxx/include/optional b/libcxx/include/optional
index 0d79d30c78f95..e9286ea1824f5 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -402,14 +402,14 @@ struct __optional_storage_base<_Tp, true>
 
     template <class _Up>
     static constexpr bool __can_bind_reference() {
-        using _RawUp = typename remove_reference<_Up>::type;
+        using _RawUp = __libcpp_remove_reference_t<_Up>;
         using _UpPtr = _RawUp*;
-        using _RawTp = typename remove_reference<_Tp>::type;
+        using _RawTp = __libcpp_remove_reference_t<_Tp>;
         using _TpPtr = _RawTp*;
         using _CheckLValueArg = integral_constant<bool,
             (is_lvalue_reference<_Up>::value && is_convertible<_UpPtr, _TpPtr>::value)
         ||  is_same<_RawUp, reference_wrapper<_RawTp>>::value
-        ||  is_same<_RawUp, reference_wrapper<typename remove_const<_RawTp>::type>>::value
+        ||  is_same<_RawUp, reference_wrapper<__remove_const_t<_RawTp>>>::value
         >;
         return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value)
             || (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value &&
@@ -637,9 +637,9 @@ public:
 
 private:
      // Disable the reference extension using this static assert.
-    static_assert(!is_same_v<__uncvref_t<value_type>, in_place_t>,
+    static_assert(!is_same_v<__remove_cvref_t<value_type>, in_place_t>,
         "instantiation of optional with in_place_t is ill-formed");
-    static_assert(!is_same_v<__uncvref_t<value_type>, nullopt_t>,
+    static_assert(!is_same_v<__remove_cvref_t<value_type>, nullopt_t>,
         "instantiation of optional with nullopt_t is ill-formed");
     static_assert(!is_reference_v<value_type>,
         "instantiation of optional with a reference type is ill-formed");
@@ -664,8 +664,8 @@ private:
     };
     template <class _Up>
     using _CheckOptionalArgsCtor = _If<
-        _IsNotSame<__uncvref_t<_Up>, in_place_t>::value &&
-        _IsNotSame<__uncvref_t<_Up>, optional>::value,
+        _IsNotSame<__remove_cvref_t<_Up>, in_place_t>::value &&
+        _IsNotSame<__remove_cvref_t<_Up>, optional>::value,
         _CheckOptionalArgsConstructor,
         __check_tuple_constructor_fail
     >;
@@ -825,9 +825,9 @@ public:
     template <class _Up = value_type,
               class = enable_if_t<
                       _And<
-                          _IsNotSame<__uncvref_t<_Up>, optional>,
+                          _IsNotSame<__remove_cvref_t<_Up>, optional>,
                           _Or<
-                              _IsNotSame<__uncvref_t<_Up>, value_type>,
+                              _IsNotSame<__remove_cvref_t<_Up>, value_type>,
                               _Not<is_scalar<value_type>>
                           >,
                           is_constructible<value_type, _Up>,

diff  --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator
index 331d92cd5971e..b38e1dbcf787a 100644
--- a/libcxx/include/scoped_allocator
+++ b/libcxx/include/scoped_allocator
@@ -401,10 +401,10 @@ struct __outermost
 template <class _Alloc>
 struct __outermost<_Alloc, true>
 {
-    typedef typename remove_reference
+    typedef __libcpp_remove_reference_t
                      <
                         decltype(declval<_Alloc>().outer_allocator())
-                     >::type                                    _OuterAlloc;
+                     >                                    _OuterAlloc;
     typedef typename __outermost<_OuterAlloc>::type             type;
     _LIBCPP_INLINE_VISIBILITY
     type& operator()(_Alloc& __a) const _NOEXCEPT

diff  --git a/libcxx/include/thread b/libcxx/include/thread
index 3ec629357ba44..47bc4c1ffd976 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -231,7 +231,7 @@ public:
     thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
 #ifndef _LIBCPP_CXX03_LANG
     template <class _Fp, class ..._Args,
-              class = __enable_if_t<!is_same<__uncvref_t<_Fp>, thread>::value> >
+              class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, thread>::value> >
         _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         explicit thread(_Fp&& __f, _Args&&... __args);
 #else  // _LIBCPP_CXX03_LANG

diff  --git a/libcxx/include/tuple b/libcxx/include/tuple
index 0241a7c54e218..038d53c5b71e0 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -300,7 +300,7 @@ public:
     template <class _Tp,
               class = __enable_if_t<
                   _And<
-                      _IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>,
+                      _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>,
                       is_constructible<_Hp, _Tp>
                     >::value
                 >
@@ -379,7 +379,7 @@ public:
     template <class _Tp,
               class = __enable_if_t<
                   _And<
-                    _IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>,
+                    _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>,
                     is_constructible<_Hp, _Tp>
                   >::value
                 >
@@ -666,7 +666,7 @@ public:
 
     // tuple(U&& ...) constructors (including allocator_arg_t variants)
     template <class ..._Up> struct _IsThisTuple : false_type { };
-    template <class _Up> struct _IsThisTuple<_Up> : is_same<__uncvref_t<_Up>, tuple> { };
+    template <class _Up> struct _IsThisTuple<_Up> : is_same<__remove_cvref_t<_Up>, tuple> { };
 
     template <class ..._Up>
     struct _EnableUTypesCtor : _And<
@@ -761,7 +761,7 @@ public:
 
     // tuple(const tuple<U...>&) constructors (including allocator_arg_t variants)
 
-    template <class _OtherTuple, class _DecayedOtherTuple = __uncvref_t<_OtherTuple>, class = void>
+    template <class _OtherTuple, class _DecayedOtherTuple = __remove_cvref_t<_OtherTuple>, class = void>
     struct _EnableCtorFromUTypesTuple : false_type {};
 
     template <class _OtherTuple, class... _Up>
@@ -913,7 +913,7 @@ public:
 
     // tuple(const pair<U1, U2>&) constructors (including allocator_arg_t variants)
 
-    template <template <class...> class Pred, class _Pair, class _DecayedPair = __uncvref_t<_Pair>, class _Tuple = tuple>
+    template <template <class...> class Pred, class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
     struct _CtorPredicateFromPair : false_type{};
 
     template <template <class...> class Pred, class _Pair, class _Up1, class _Up2, class _Tp1, class _Tp2>
@@ -928,7 +928,7 @@ public:
     template <class _Pair>
     struct _NothrowConstructibleFromPair : _CtorPredicateFromPair<is_nothrow_constructible, _Pair>{};
 
-    template <class _Pair, class _DecayedPair = __uncvref_t<_Pair>, class _Tuple = tuple>
+    template <class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
     struct _BothImplicitlyConvertible : false_type{};
 
     template <class _Pair, class _Up1, class _Up2, class _Tp1, class _Tp2>
@@ -1161,7 +1161,7 @@ public:
 #endif // _LIBCPP_STD_VER > 20
 
     template <template<class...> class Pred, bool _Const,
-              class _Pair, class _DecayedPair = __uncvref_t<_Pair>, class _Tuple = tuple>
+              class _Pair, class _DecayedPair = __remove_cvref_t<_Pair>, class _Tuple = tuple>
     struct _AssignPredicateFromPair : false_type {};
 
     template <template<class...> class Pred, bool _Const,
@@ -1631,7 +1631,7 @@ struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0>
 {
   using type _LIBCPP_NODEBUG = typename __tuple_cat_type<
       tuple<_Types...>,
-      typename __make_tuple_types<__uncvref_t<_Tuple0> >::type
+      typename __make_tuple_types<__remove_cvref_t<_Tuple0> >::type
     >::type;
 };
 
@@ -1640,9 +1640,9 @@ struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...
     : public __tuple_cat_return_1<
                  typename __tuple_cat_type<
                      tuple<_Types...>,
-                     typename __make_tuple_types<__uncvref_t<_Tuple0> >::type
+                     typename __make_tuple_types<__remove_cvref_t<_Tuple0> >::type
                  >::type,
-                 __tuple_like<typename remove_reference<_Tuple1>::type>::value,
+                 __tuple_like<__libcpp_remove_reference_t<_Tuple1> >::value,
                  _Tuple1, _Tuples...>
 {
 };
@@ -1652,7 +1652,7 @@ template <class ..._Tuples> struct __tuple_cat_return;
 template <class _Tuple0, class ..._Tuples>
 struct __tuple_cat_return<_Tuple0, _Tuples...>
     : public __tuple_cat_return_1<tuple<>,
-         __tuple_like<typename remove_reference<_Tuple0>::type>::value, _Tuple0,
+         __tuple_like<__libcpp_remove_reference_t<_Tuple0> >::value, _Tuple0,
                                                                      _Tuples...>
 {
 };
@@ -1676,7 +1676,7 @@ struct __tuple_cat_return_ref_imp;
 template <class ..._Types, size_t ..._I0, class _Tuple0>
 struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0>
 {
-    typedef _LIBCPP_NODEBUG typename remove_reference<_Tuple0>::type _T0;
+    typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0;
     typedef tuple<_Types..., typename __apply_cv<_Tuple0,
                           typename tuple_element<_I0, _T0>::type>::type&&...> type;
 };
@@ -1687,9 +1687,8 @@ struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>,
     : public __tuple_cat_return_ref_imp<
          tuple<_Types..., typename __apply_cv<_Tuple0,
                typename tuple_element<_I0,
-                  typename remove_reference<_Tuple0>::type>::type>::type&&...>,
-         typename __make_tuple_indices<tuple_size<typename
-                                 remove_reference<_Tuple1>::type>::value>::type,
+                  __libcpp_remove_reference_t<_Tuple0> >::type>::type&&...>,
+         typename __make_tuple_indices<tuple_size<__libcpp_remove_reference_t<_Tuple1> >::value>::type,
          _Tuple1, _Tuples...>
 {
 };
@@ -1698,7 +1697,7 @@ template <class _Tuple0, class ..._Tuples>
 struct __tuple_cat_return_ref
     : public __tuple_cat_return_ref_imp<tuple<>,
                typename __make_tuple_indices<
-                        tuple_size<typename remove_reference<_Tuple0>::type>::value
+                        tuple_size<__libcpp_remove_reference_t<_Tuple0> >::value
                >::type, _Tuple0, _Tuples...>
 {
 };
@@ -1726,8 +1725,8 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
     operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls)
     {
         (void)__t; // avoid unused parameter warning on GCC when _I0 is empty
-        typedef _LIBCPP_NODEBUG typename remove_reference<_Tuple0>::type _T0;
-        typedef _LIBCPP_NODEBUG typename remove_reference<_Tuple1>::type _T1;
+        typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0;
+        typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple1> _T1;
         return __tuple_cat<
             tuple<_Types...,
                   typename __apply_cv<_Tuple0, typename tuple_element<
@@ -1747,7 +1746,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
 typename __tuple_cat_return<_Tuple0, _Tuples...>::type
 tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
 {
-    typedef _LIBCPP_NODEBUG typename remove_reference<_Tuple0>::type _T0;
+    typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tuple0> _T0;
     return __tuple_cat<tuple<>, __tuple_indices<>,
                   typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
                   (tuple<>(), _VSTD::forward<_Tuple0>(__t0),

diff  --git a/libcxx/include/valarray b/libcxx/include/valarray
index ff745d30122d6..e0f07537d3e38 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -684,7 +684,7 @@ struct __tanh_expr
 template <class _ValExpr>
 class __slice_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 public:
     typedef typename _RmExpr::value_type value_type;
     typedef value_type __result_type;
@@ -724,7 +724,7 @@ class __indirect_expr;
 template <class _ValExpr>
 class __shift_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 public:
     typedef typename _RmExpr::value_type value_type;
     typedef value_type __result_type;
@@ -767,7 +767,7 @@ public:
 template <class _ValExpr>
 class __cshift_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 public:
     typedef typename _RmExpr::value_type value_type;
     typedef value_type __result_type;
@@ -2242,7 +2242,7 @@ mask_array<_Tp>::operator=(const value_type& __x) const
 template <class _ValExpr>
 class __mask_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 public:
     typedef typename _RmExpr::value_type value_type;
     typedef value_type __result_type;
@@ -2605,7 +2605,7 @@ indirect_array<_Tp>::operator=(const value_type& __x) const
 template <class _ValExpr>
 class __indirect_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 public:
     typedef typename _RmExpr::value_type value_type;
     typedef value_type __result_type;
@@ -2645,7 +2645,7 @@ public:
 template<class _ValExpr>
 class __val_expr
 {
-    typedef typename remove_reference<_ValExpr>::type  _RmExpr;
+    typedef __libcpp_remove_reference_t<_ValExpr>  _RmExpr;
 
     _ValExpr __expr_;
 public:

diff  --git a/libcxx/include/variant b/libcxx/include/variant
index 32a1795924c6e..afb861f81243a 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -538,8 +538,8 @@ private:
   template <class... _Fs>
   _LIBCPP_HIDE_FROM_ABI
   static constexpr auto __make_farray(_Fs&&... __fs) {
-    __std_visit_visitor_return_type_check<__uncvref_t<_Fs>...>();
-    using __result = __farray<common_type_t<__uncvref_t<_Fs>...>, sizeof...(_Fs)>;
+    __std_visit_visitor_return_type_check<__remove_cvref_t<_Fs>...>();
+    using __result = __farray<common_type_t<__remove_cvref_t<_Fs>...>, sizeof...(_Fs)>;
     return __result{{_VSTD::forward<_Fs>(__fs)...}};
   }
 
@@ -576,8 +576,8 @@ private:
   template <class _Fp, class _Vp, class... _Vs>
   _LIBCPP_HIDE_FROM_ABI
   static constexpr auto __make_fdiagonal() {
-    constexpr size_t _Np = __uncvref_t<_Vp>::__size();
-    static_assert(__all<(_Np == __uncvref_t<_Vs>::__size())...>::value);
+    constexpr size_t _Np = __remove_cvref_t<_Vp>::__size();
+    static_assert(__all<(_Np == __remove_cvref_t<_Vs>::__size())...>::value);
     return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{});
   }
 
@@ -600,7 +600,7 @@ private:
   _LIBCPP_HIDE_FROM_ABI
   static constexpr auto __make_fmatrix() {
     return __make_fmatrix_impl<_Fp, _Vs...>(
-        index_sequence<>{}, make_index_sequence<__uncvref_t<_Vs>::__size()>{}...);
+        index_sequence<>{}, make_index_sequence<__remove_cvref_t<_Vs>::__size()>{}...);
   }
 };
 
@@ -861,7 +861,7 @@ _LIBCPP_VARIANT_DESTRUCTOR(
       if (!this->valueless_by_exception()) {
         __visitation::__base::__visit_alt(
             [](auto& __alt) noexcept {
-              using __alt_type = __uncvref_t<decltype(__alt)>;
+              using __alt_type = __remove_cvref_t<decltype(__alt)>;
               __alt.~__alt_type();
             },
             *this);
@@ -1233,7 +1233,7 @@ struct __overload {
 
 template <class _Tp, size_t>
 struct __overload_bool  {
-  template <class _Up, class _Ap = __uncvref_t<_Up>>
+  template <class _Up, class _Ap = __remove_cvref_t<_Up>>
   auto operator()(bool, _Up&&) const
       -> enable_if_t<is_same_v<_Ap, bool>, __type_identity<_Tp>>;
 };
@@ -1310,9 +1310,9 @@ public:
 
   template <
       class _Arg,
-      enable_if_t<!is_same_v<__uncvref_t<_Arg>, variant>, int> = 0,
-      enable_if_t<!__is_inplace_type<__uncvref_t<_Arg>>::value, int> = 0,
-      enable_if_t<!__is_inplace_index<__uncvref_t<_Arg>>::value, int> = 0,
+      enable_if_t<!is_same_v<__remove_cvref_t<_Arg>, variant>, int> = 0,
+      enable_if_t<!__is_inplace_type<__remove_cvref_t<_Arg>>::value, int> = 0,
+      enable_if_t<!__is_inplace_index<__remove_cvref_t<_Arg>>::value, int> = 0,
       class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
       size_t _Ip =
           __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
@@ -1382,7 +1382,7 @@ public:
 
   template <
       class _Arg,
-      enable_if_t<!is_same_v<__uncvref_t<_Arg>, variant>, int> = 0,
+      enable_if_t<!is_same_v<__remove_cvref_t<_Arg>, variant>, int> = 0,
       class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
       size_t _Ip =
           __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
@@ -1774,7 +1774,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<
                ? 299792458 // Random value chosen by the universe upon creation
                : __variant::__visit_alt(
                      [](const auto& __alt) {
-                       using __alt_type = __uncvref_t<decltype(__alt)>;
+                       using __alt_type = __remove_cvref_t<decltype(__alt)>;
                        using __value_type = remove_const_t<
                          typename __alt_type::__value_type>;
                        return hash<__value_type>{}(__alt.__value);

diff  --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index 8db129520ee50..db211b2242776 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -85,7 +85,7 @@ template<typename V, typename S, typename F>
 inline V as_integer_helper(const string& func, const S& str, size_t* idx, int base, F f) {
     typename S::value_type* ptr = nullptr;
     const typename S::value_type* const p = str.c_str();
-    typename remove_reference<decltype(errno)>::type errno_save = errno;
+    __libcpp_remove_reference_t<decltype(errno)> errno_save = errno;
     errno = 0;
     V r = f(p, &ptr, base);
     swap(errno, errno_save);
@@ -172,7 +172,7 @@ template<typename V, typename S, typename F>
 inline V as_float_helper(const string& func, const S& str, size_t* idx, F f) {
     typename S::value_type* ptr = nullptr;
     const typename S::value_type* const p = str.c_str();
-    typename remove_reference<decltype(errno)>::type errno_save = errno;
+    __libcpp_remove_reference_t<decltype(errno)> errno_save = errno;
     errno = 0;
     V r = f(p, &ptr);
     swap(errno, errno_save);


        


More information about the libcxx-commits mailing list