diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index 6bc72341cf3862..b73afae4bce6f5 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -1164,7 +1164,8 @@ class DenseMapIterator : DebugEpochBase::HandleBase { public: using difference_type = ptrdiff_t; - using value_type = std::conditional_t; + using value_type = + typename std::conditional::type; 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 index caed60efefa7c6..121aa527a5dac4 100644 --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -62,12 +62,12 @@ class unique_function { // 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 = - std::conditional_t::value && - llvm::is_trivially_copy_constructible::value && - llvm::is_trivially_move_constructible::value && - IsSizeLessThanThresholdT::value, - T, T &>; + 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; // 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,7 +112,8 @@ class unique_function { // For in-line storage, we just provide an aligned character buffer. We // provide three pointers worth of storage here. - std::aligned_storage_t InlineStorage; + typename std::aligned_storage::type + 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 index aa672c315a2f0d..c9ee494734e7f2 100644 --- a/llvm/include/llvm/ADT/ImmutableList.h +++ b/llvm/include/llvm/ADT/ImmutableList.h @@ -93,7 +93,7 @@ class ImmutableList { 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 std::remove_reference_t *operator->() const { + const typename std::remove_reference::type* operator->() const { return &L->getHead(); } diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 3bb773cb35f7cf..8888e8d489784e 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -63,14 +63,16 @@ template struct conjunction : std::true_type {}; template struct conjunction : B1 {}; template struct conjunction - : std::conditional_t, B1> {}; + : std::conditional, B1>::type {}; template struct make_const_ptr { - using type = std::add_pointer_t>; + using type = + typename std::add_pointer::type>::type; }; template struct make_const_ref { - using type = std::add_lvalue_reference_t>; + using type = typename std::add_lvalue_reference< + typename std::add_const::type>::type; }; //===----------------------------------------------------------------------===// @@ -115,7 +117,7 @@ class function_ref { function_ref(Callable &&callable, std::enable_if_t, function_ref>::value> * = nullptr) - : callback(callback_fn>), + : callback(callback_fn::type>), callable(reinterpret_cast(&callable)) {} Ret operator()(Params ...params) const { @@ -198,12 +200,12 @@ template auto drop_begin(T &&RangeOrContainer, size_t N) { template ()(*std::declval()))> + decltype(std::declval()(*std::declval()))> class mapped_iterator : public iterator_adaptor_base< - mapped_iterator, ItTy, - typename std::iterator_traits::iterator_category, - std::remove_reference_t> { + mapped_iterator, ItTy, + typename std::iterator_traits::iterator_category, + typename std::remove_reference::type> { public: mapped_iterator(ItTy U, FuncTy F) : mapped_iterator::iterator_adaptor_base(std::move(U)), F(std::move(F)) {} @@ -245,7 +247,8 @@ template class has_rbegin_impl { /// Metafunction to determine if T& or T has a member called rbegin(). template -struct has_rbegin : has_rbegin_impl> {}; +struct has_rbegin : has_rbegin_impl::type> { +}; // 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. @@ -292,14 +295,15 @@ class filter_iterator_base : public iterator_adaptor_base< filter_iterator_base, WrappedIteratorT, - std::common_type_t::iterator_category>> { + typename std::common_type< + IterTag, typename std::iterator_traits< + WrappedIteratorT>::iterator_category>::type> { using BaseT = iterator_adaptor_base< filter_iterator_base, WrappedIteratorT, - std::common_type_t::iterator_category>>; + typename std::common_type< + IterTag, typename std::iterator_traits< + WrappedIteratorT>::iterator_category>::type>; protected: WrappedIteratorT End; @@ -517,10 +521,9 @@ template struct ZipTupleType { template using zip_traits = iterator_facade_base< - ZipType, - std::common_type_t< - std::bidirectional_iterator_tag, - typename std::iterator_traits::iterator_category...>, + ZipType, typename std::common_type::iterator_category...>::type, // ^ TODO: Implement random access methods. typename ZipTupleType::type, typename std::iterator_traits llvm::Optional< } template struct ZipLongestItemType { - using type = llvm::Optional())>>>; + using type = + llvm::Optional())>::type>::type>; }; template struct ZipLongestTupleType { @@ -684,12 +688,12 @@ template class zip_longest_iterator : public iterator_facade_base< zip_longest_iterator, - std::common_type_t< + typename std::common_type< std::forward_iterator_tag, - typename std::iterator_traits::iterator_category...>, + typename std::iterator_traits::iterator_category...>::type, typename ZipLongestTupleType::type, - typename std::iterator_traits< - std::tuple_element_t<0, std::tuple>>::difference_type, + typename std::iterator_traits>::type>::difference_type, typename ZipLongestTupleType::type *, typename ZipLongestTupleType::type> { public: @@ -1497,8 +1501,8 @@ decltype(auto) apply_tuple_impl(F &&f, Tuple &&t, std::index_sequence) { /// return the result. template decltype(auto) apply_tuple(F &&f, Tuple &&t) { - using Indices = - std::make_index_sequence>::value>; + using Indices = std::make_index_sequence< + std::tuple_size::type>::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 index 4e52d969d6165a..712d91237739e9 100644 --- a/llvm/include/llvm/ADT/ScopeExit.h +++ b/llvm/include/llvm/ADT/ScopeExit.h @@ -54,9 +54,10 @@ template class scope_exit { // // Interface is specified by p0052r2. template -LLVM_NODISCARD detail::scope_exit> +LLVM_NODISCARD detail::scope_exit::type> make_scope_exit(Callable &&F) { - return detail::scope_exit>(std::forward(F)); + return detail::scope_exit::type>( + std::forward(F)); } } // end namespace llvm diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index bcec1720760b72..28b514d530dc93 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -284,8 +284,8 @@ class SmallVectorTemplateBase : public SmallVectorTemplateCommon { template static void uninitialized_copy( T1 *I, T1 *E, T2 *Dest, - std::enable_if_t, T2>::value> * = - nullptr) { + std::enable_if_t::type, + 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 @@ inline size_t capacity_in_bytes(const SmallVector &X) { /// 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()))>>, +SmallVector()))>::type>::type, Size> to_vector(R &&Range) { return {std::begin(Range), std::end(Range)};