From 335f94bfef0e9a53a44de2f0a2a62b29e2c593e9 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 17 Oct 2022 10:55:50 +0000 Subject: [PATCH] Revert "[llvm] Remove redundaunt typename (NFC)" This reverts commit 3577e606dad0fa8f54e29e24673ff63bb7dfa880. Due to buildbot failures on Arm and Arm64. https://lab.llvm.org/buildbot/#/builders/96/builds/30231 --- llvm/include/llvm/ADT/FoldingSet.h | 4 ++-- llvm/include/llvm/ADT/STLExtras.h | 3 ++- llvm/include/llvm/ADT/Sequence.h | 12 ++++++------ llvm/include/llvm/ADT/TypeSwitch.h | 8 ++++---- llvm/include/llvm/Support/TypeSize.h | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h index 2376689..ec276d4 100644 --- a/llvm/include/llvm/ADT/FoldingSet.h +++ b/llvm/include/llvm/ADT/FoldingSet.h @@ -830,9 +830,9 @@ struct FoldingSetTrait> { }; template -struct FoldingSetTrait::value>> { +struct FoldingSetTrait::value>> { static void Profile(const T &X, FoldingSetNodeID &ID) { - ID.AddInteger(static_cast>(X)); + ID.AddInteger(static_cast>(X)); } }; diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 2c242b3..5fa5c0b 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1295,7 +1295,8 @@ namespace detail { /// always be a reference, to avoid returning a reference to a temporary. template class first_or_second_type { public: - using type = std::conditional_t::value, FirstTy, + using type = + typename std::conditional_t::value, FirstTy, std::remove_reference_t>; }; } // end namespace detail diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h index 1153352..88a6fa9 100644 --- a/llvm/include/llvm/ADT/Sequence.h +++ b/llvm/include/llvm/ADT/Sequence.h @@ -125,8 +125,8 @@ template bool canTypeFitValue(const U Value) { // - its internal representation overflows. struct CheckedInt { // Integral constructor, asserts if Value cannot be represented as intmax_t. - template ::value, bool> = 0> + template ::value, bool> = 0> static CheckedInt from(Integral FromValue) { if (!canTypeFitValue(FromValue)) assertOutOfBounds(); @@ -137,7 +137,7 @@ struct CheckedInt { // Enum constructor, asserts if Value cannot be represented as intmax_t. template ::value, bool> = 0> + typename std::enable_if_t::value, bool> = 0> static CheckedInt from(Enum FromValue) { using type = std::underlying_type_t; return from(static_cast(FromValue)); @@ -162,8 +162,8 @@ struct CheckedInt { } // Convert to integral, asserts if Value cannot be represented as Integral. - template ::value, bool> = 0> + template ::value, bool> = 0> Integral to() const { if (!canTypeFitValue(Value)) assertOutOfBounds(); @@ -173,7 +173,7 @@ struct CheckedInt { // Convert to enum, asserts if Value cannot be represented as Enum's // underlying type. template ::value, bool> = 0> + typename std::enable_if_t::value, bool> = 0> Enum to() const { using type = std::underlying_type_t; return Enum(to()); diff --git a/llvm/include/llvm/ADT/TypeSwitch.h b/llvm/include/llvm/ADT/TypeSwitch.h index cf58808..cc69f76 100644 --- a/llvm/include/llvm/ADT/TypeSwitch.h +++ b/llvm/include/llvm/ADT/TypeSwitch.h @@ -72,8 +72,8 @@ protected: template static auto castValue( ValueT value, - std::enable_if_t::value> * = - nullptr) { + typename std::enable_if_t< + is_detected::value> * = nullptr) { return value.template dyn_cast(); } @@ -82,8 +82,8 @@ protected: template static auto castValue( ValueT value, - std::enable_if_t::value> * = - nullptr) { + typename std::enable_if_t< + !is_detected::value> * = nullptr) { return dyn_cast(value); } diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h index 9cf2e87..0777005 100644 --- a/llvm/include/llvm/Support/TypeSize.h +++ b/llvm/include/llvm/Support/TypeSize.h @@ -93,7 +93,7 @@ public: } template - friend std::enable_if_t::value, LeafTy> + friend typename std::enable_if_t::value, LeafTy> operator-(const LeafTy &LHS) { LeafTy Copy = LHS; return Copy *= -1; -- 2.7.4