diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -1164,8 +1164,7 @@ public: using difference_type = ptrdiff_t; - using value_type = - typename std::conditional::type; + using value_type = std::conditional_t; using pointer = value_type *; using reference = value_type &; using iterator_category = std::forward_iterator_tag; diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -62,12 +62,12 @@ // It doesn't have to be exact though, and in one way it is more strict // because we want to still be able to observe either moves *or* copies. template - using AdjustedParamT = typename std::conditional< - !std::is_reference::value && - llvm::is_trivially_copy_constructible::value && - llvm::is_trivially_move_constructible::value && - IsSizeLessThanThresholdT::value, - T, T &>::type; + using AdjustedParamT = + std::conditional_t::value && + llvm::is_trivially_copy_constructible::value && + llvm::is_trivially_move_constructible::value && + IsSizeLessThanThresholdT::value, + T, T &>; // The type of the erased function pointer we use as a callback to dispatch to // the stored callable when it is trivial to move and destroy. @@ -112,8 +112,7 @@ // For in-line storage, we just provide an aligned character buffer. We // provide three pointers worth of storage here. - typename std::aligned_storage::type - InlineStorage; + std::aligned_storage_t InlineStorage; } StorageUnion; // A compressed pointer to either our dispatching callback or our table of diff --git a/llvm/include/llvm/ADT/ImmutableList.h b/llvm/include/llvm/ADT/ImmutableList.h --- a/llvm/include/llvm/ADT/ImmutableList.h +++ b/llvm/include/llvm/ADT/ImmutableList.h @@ -93,7 +93,7 @@ bool operator==(const iterator& I) const { return L == I.L; } bool operator!=(const iterator& I) const { return L != I.L; } const value_type& operator*() const { return L->getHead(); } - const typename std::remove_reference::type* operator->() const { + const std::remove_reference_t *operator->() const { return &L->getHead(); } diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -63,16 +63,14 @@ template struct conjunction : B1 {}; template struct conjunction - : std::conditional, B1>::type {}; + : std::conditional_t, B1> {}; template struct make_const_ptr { - using type = - typename std::add_pointer::type>::type; + using type = std::add_pointer_t>; }; template struct make_const_ref { - using type = typename std::add_lvalue_reference< - typename std::add_const::type>::type; + using type = std::add_lvalue_reference_t>; }; //===----------------------------------------------------------------------===// @@ -117,7 +115,7 @@ function_ref(Callable &&callable, std::enable_if_t, function_ref>::value> * = nullptr) - : callback(callback_fn::type>), + : callback(callback_fn>), callable(reinterpret_cast(&callable)) {} Ret operator()(Params ...params) const { @@ -200,12 +198,12 @@ template ()(*std::declval()))> + decltype(std::declval()(*std::declval()))> class mapped_iterator : public iterator_adaptor_base< - mapped_iterator, ItTy, - typename std::iterator_traits::iterator_category, - typename std::remove_reference::type> { + mapped_iterator, ItTy, + typename std::iterator_traits::iterator_category, + std::remove_reference_t> { public: mapped_iterator(ItTy U, FuncTy F) : mapped_iterator::iterator_adaptor_base(std::move(U)), F(std::move(F)) {} @@ -247,8 +245,7 @@ /// Metafunction to determine if T& or T has a member called rbegin(). template -struct has_rbegin : has_rbegin_impl::type> { -}; +struct has_rbegin : has_rbegin_impl> {}; // Returns an iterator_range over the given container which iterates in reverse. // Note that the container must have rbegin()/rend() methods for this to work. @@ -295,15 +292,14 @@ : public iterator_adaptor_base< filter_iterator_base, WrappedIteratorT, - typename std::common_type< - IterTag, typename std::iterator_traits< - WrappedIteratorT>::iterator_category>::type> { + std::common_type_t::iterator_category>> { using BaseT = iterator_adaptor_base< filter_iterator_base, WrappedIteratorT, - typename std::common_type< - IterTag, typename std::iterator_traits< - WrappedIteratorT>::iterator_category>::type>; + std::common_type_t::iterator_category>>; protected: WrappedIteratorT End; @@ -521,9 +517,10 @@ template using zip_traits = iterator_facade_base< - ZipType, typename std::common_type::iterator_category...>::type, + ZipType, + std::common_type_t< + std::bidirectional_iterator_tag, + typename std::iterator_traits::iterator_category...>, // ^ TODO: Implement random access methods. typename ZipTupleType::type, typename std::iterator_traits struct ZipLongestItemType { - using type = - llvm::Optional())>::type>::type>; + using type = llvm::Optional())>>>; }; template struct ZipLongestTupleType { @@ -688,12 +684,12 @@ class zip_longest_iterator : public iterator_facade_base< zip_longest_iterator, - typename std::common_type< + std::common_type_t< std::forward_iterator_tag, - typename std::iterator_traits::iterator_category...>::type, + typename std::iterator_traits::iterator_category...>, typename ZipLongestTupleType::type, - typename std::iterator_traits>::type>::difference_type, + typename std::iterator_traits< + std::tuple_element_t<0, std::tuple>>::difference_type, typename ZipLongestTupleType::type *, typename ZipLongestTupleType::type> { public: @@ -1501,8 +1497,8 @@ /// return the result. template decltype(auto) apply_tuple(F &&f, Tuple &&t) { - using Indices = std::make_index_sequence< - std::tuple_size::type>::value>; + using Indices = + std::make_index_sequence>::value>; return detail::apply_tuple_impl(std::forward(f), std::forward(t), Indices{}); diff --git a/llvm/include/llvm/ADT/ScopeExit.h b/llvm/include/llvm/ADT/ScopeExit.h --- a/llvm/include/llvm/ADT/ScopeExit.h +++ b/llvm/include/llvm/ADT/ScopeExit.h @@ -54,10 +54,9 @@ // // Interface is specified by p0052r2. template -LLVM_NODISCARD detail::scope_exit::type> +LLVM_NODISCARD detail::scope_exit> make_scope_exit(Callable &&F) { - return detail::scope_exit::type>( - std::forward(F)); + return detail::scope_exit>(std::forward(F)); } } // end namespace llvm diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -284,8 +284,8 @@ template static void uninitialized_copy( T1 *I, T1 *E, T2 *Dest, - std::enable_if_t::type, - T2>::value> * = nullptr) { + std::enable_if_t, T2>::value> * = + nullptr) { // Use memcpy for PODs iterated by pointers (which includes SmallVector // iterators): std::uninitialized_copy optimizes to memmove, but we can // use memcpy here. Note that I and E are iterators and thus might be @@ -911,8 +911,8 @@ /// SmallVector with elements of the vector. This is useful, for example, /// when you want to iterate a range and then sort the results. template -SmallVector()))>::type>::type, +SmallVector()))>>, Size> to_vector(R &&Range) { return {std::begin(Range), std::end(Range)};