[llvm] 632a389 - Revert "[llvm][NFC] Use c++17 style variable type traits"
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 11 14:40:37 PST 2022
Please include details on the reason for revert in a revert commit message.
On Tue, Nov 8, 2022 at 5:11 AM Nathan James via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Nathan James
> Date: 2022-11-08T13:11:41Z
> New Revision: 632a389f96355cbe7ed8fa7b8d2ed6267c92457c
>
> URL: https://github.com/llvm/llvm-project/commit/632a389f96355cbe7ed8fa7b8d2ed6267c92457c
> DIFF: https://github.com/llvm/llvm-project/commit/632a389f96355cbe7ed8fa7b8d2ed6267c92457c.diff
>
> LOG: Revert "[llvm][NFC] Use c++17 style variable type traits"
>
> This reverts commit 1834a310d060d55748ca38d4ae0482864c2047d8.
>
> Added:
>
>
> Modified:
> llvm/include/llvm/Support/YAMLTraits.h
> llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
> llvm/lib/DebugInfo/CodeView/EnumTables.cpp
> llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp
> llvm/lib/Object/DXContainer.cpp
> llvm/lib/ProfileData/InstrProf.cpp
> llvm/lib/Support/ItaniumManglingCanonicalizer.cpp
> llvm/lib/Support/NativeFormatting.cpp
> llvm/lib/Target/X86/X86ISelLowering.cpp
> llvm/lib/Transforms/Scalar/NaryReassociate.cpp
> llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
> llvm/unittests/ADT/ArrayRefTest.cpp
> llvm/unittests/ADT/DenseMapTest.cpp
> llvm/unittests/ADT/DenseSetTest.cpp
> llvm/unittests/ADT/EnumeratedArrayTest.cpp
> llvm/unittests/ADT/IListIteratorTest.cpp
> llvm/unittests/ADT/IListNodeTest.cpp
> llvm/unittests/ADT/ImmutableListTest.cpp
> llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
> llvm/unittests/ADT/IteratorTest.cpp
> llvm/unittests/ADT/OptionalTest.cpp
> llvm/unittests/ADT/PointerIntPairTest.cpp
> llvm/unittests/ADT/PointerUnionTest.cpp
> llvm/unittests/ADT/SmallVectorTest.cpp
> llvm/unittests/ADT/StringRefTest.cpp
> llvm/unittests/ADT/TypeTraitsTest.cpp
> llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
> llvm/unittests/Analysis/CallGraphTest.cpp
> llvm/unittests/Bitstream/BitstreamReaderTest.cpp
> llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
> llvm/unittests/CodeGen/MachineInstrTest.cpp
> llvm/unittests/CodeGen/TypeTraitsTest.cpp
> llvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp
> llvm/unittests/IR/CFGBuilder.cpp
> llvm/unittests/IR/DominatorTreeBatchUpdatesTest.cpp
> llvm/unittests/IR/PassBuilderCallbacksTest.cpp
> llvm/unittests/IR/ValueMapTest.cpp
> llvm/unittests/Support/Casting.cpp
> llvm/unittests/Support/ErrorOrTest.cpp
> llvm/unittests/Support/ScaledNumberTest.cpp
> llvm/unittests/Support/ThreadLocalTest.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
> index cb0588a7203bd..8ade9b15642b5 100644
> --- a/llvm/include/llvm/Support/YAMLTraits.h
> +++ b/llvm/include/llvm/Support/YAMLTraits.h
> @@ -2019,8 +2019,9 @@ template <typename T> struct StdMapStringCustomMappingTraitsImpl {
> namespace llvm { \
> namespace yaml { \
> static_assert( \
> - !std::is_fundamental_v<TYPE> && !std::is_same_v<TYPE, std::string> && \
> - !std::is_same_v<TYPE, llvm::StringRef>, \
> + !std::is_fundamental<TYPE>::value && \
> + !std::is_same<TYPE, std::string>::value && \
> + !std::is_same<TYPE, llvm::StringRef>::value, \
> "only use LLVM_YAML_IS_SEQUENCE_VECTOR for types you control"); \
> template <> struct SequenceElementTraits<TYPE> { \
> static const bool flow = FLOW; \
>
> diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
> index 7706b3f1f2d86..32e07eb77efe2 100644
> --- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
> +++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
> @@ -237,7 +237,8 @@ struct LocIndex {
> }
>
> template<typename IntT> static LocIndex fromRawInteger(IntT ID) {
> - static_assert(std::is_unsigned_v<IntT> && sizeof(ID) == sizeof(uint64_t),
> + static_assert(std::is_unsigned<IntT>::value &&
> + sizeof(ID) == sizeof(uint64_t),
> "Cannot convert raw integer to LocIndex");
> return {static_cast<u32_location_t>(ID >> 32),
> static_cast<u32_index_t>(ID)};
>
> diff --git a/llvm/lib/DebugInfo/CodeView/EnumTables.cpp b/llvm/lib/DebugInfo/CodeView/EnumTables.cpp
> index 1774b35921bdb..adf4ae519dae8 100644
> --- a/llvm/lib/DebugInfo/CodeView/EnumTables.cpp
> +++ b/llvm/lib/DebugInfo/CodeView/EnumTables.cpp
> @@ -14,7 +14,7 @@ using namespace llvm;
> using namespace codeview;
>
> #define CV_ENUM_CLASS_ENT(enum_class, enum) \
> - { #enum, std::underlying_type_t<enum_class>(enum_class::enum) }
> + { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) }
>
> #define CV_ENUM_ENT(ns, enum) \
> { #enum, ns::enum }
>
> diff --git a/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp b/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> index 96ec7f656bb6a..6507132cb3ecb 100644
> --- a/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> +++ b/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> @@ -27,7 +27,7 @@ static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
> };
>
> #define ENUM_ENTRY(enum_class, enum) \
> - { #enum, std::underlying_type_t<enum_class>(enum_class::enum) }
> + { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) }
>
> static const EnumEntry<uint16_t> ClassOptionNames[] = {
> ENUM_ENTRY(ClassOptions, Packed),
>
> diff --git a/llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp b/llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp
> index ff88e2b4e79a9..32bad9cea7ce1 100644
> --- a/llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp
> +++ b/llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp
> @@ -14,7 +14,7 @@ using namespace llvm;
> using namespace llvm::pdb;
>
> #define PDB_ENUM_CLASS_ENT(enum_class, enum) \
> - { #enum, std::underlying_type_t<enum_class>(enum_class::enum) }
> + { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) }
>
> #define PDB_ENUM_ENT(ns, enum) \
> { #enum, ns::enum }
>
> diff --git a/llvm/lib/Object/DXContainer.cpp b/llvm/lib/Object/DXContainer.cpp
> index 35a58ed82e8cc..a83cf70b31741 100644
> --- a/llvm/lib/Object/DXContainer.cpp
> +++ b/llvm/lib/Object/DXContainer.cpp
> @@ -32,7 +32,7 @@ static Error readStruct(StringRef Buffer, const char *Src, T &Struct) {
>
> template <typename T>
> static Error readInteger(StringRef Buffer, const char *Src, T &Val) {
> - static_assert(std::is_integral_v<T>,
> + static_assert(std::is_integral<T>::value,
> "Cannot call readInteger on non-integral type.");
> // Don't read before the beginning or past the end of the file
> if (Src < Buffer.begin() || Src + sizeof(T) > Buffer.end())
>
> diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
> index fec25a84423f7..eab1eab82ac2f 100644
> --- a/llvm/lib/ProfileData/InstrProf.cpp
> +++ b/llvm/lib/ProfileData/InstrProf.cpp
> @@ -1351,7 +1351,7 @@ uint64_t Header::formatVersion() const {
>
> Expected<Header> Header::readFromBuffer(const unsigned char *Buffer) {
> using namespace support;
> - static_assert(std::is_standard_layout_v<Header>,
> + static_assert(std::is_standard_layout<Header>::value,
> "The header should be standard layout type since we use offset "
> "of fields to read.");
> Header H;
>
> diff --git a/llvm/lib/Support/ItaniumManglingCanonicalizer.cpp b/llvm/lib/Support/ItaniumManglingCanonicalizer.cpp
> index d95d84f7837e9..52d5de93ff7d7 100644
> --- a/llvm/lib/Support/ItaniumManglingCanonicalizer.cpp
> +++ b/llvm/lib/Support/ItaniumManglingCanonicalizer.cpp
> @@ -27,7 +27,8 @@ struct FoldingSetNodeIDBuilder {
> ID.AddString(llvm::StringRef(Str.begin(), Str.size()));
> }
> template <typename T>
> - std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>> operator()(T V) {
> + std::enable_if_t<std::is_integral<T>::value || std::is_enum<T>::value>
> + operator()(T V) {
> ID.AddInteger((unsigned long long)V);
> }
> void operator()(itanium_demangle::NodeArray A) {
>
> diff --git a/llvm/lib/Support/NativeFormatting.cpp b/llvm/lib/Support/NativeFormatting.cpp
> index ee2d8853dd629..cceaad4e8b9e6 100644
> --- a/llvm/lib/Support/NativeFormatting.cpp
> +++ b/llvm/lib/Support/NativeFormatting.cpp
> @@ -55,7 +55,7 @@ static void writeWithCommas(raw_ostream &S, ArrayRef<char> Buffer) {
> template <typename T>
> static void write_unsigned_impl(raw_ostream &S, T N, size_t MinDigits,
> IntegerStyle Style, bool IsNegative) {
> - static_assert(std::is_unsigned_v<T>, "Value is not unsigned!");
> + static_assert(std::is_unsigned<T>::value, "Value is not unsigned!");
>
> char NumberBuffer[128];
> std::memset(NumberBuffer, '0', sizeof(NumberBuffer));
> @@ -92,7 +92,7 @@ static void write_unsigned(raw_ostream &S, T N, size_t MinDigits,
> template <typename T>
> static void write_signed(raw_ostream &S, T N, size_t MinDigits,
> IntegerStyle Style) {
> - static_assert(std::is_signed_v<T>, "Value is not signed!");
> + static_assert(std::is_signed<T>::value, "Value is not signed!");
>
> using UnsignedT = std::make_unsigned_t<T>;
>
>
> diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
> index 2884fee57a1a2..e32b0cb3d45e4 100644
> --- a/llvm/lib/Target/X86/X86ISelLowering.cpp
> +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
> @@ -3574,8 +3574,8 @@ template <typename T>
> static bool hasCalleePopSRet(const SmallVectorImpl<T> &Args,
> const X86Subtarget &Subtarget) {
> // Not C++20 (yet), so no concepts available.
> - static_assert(std::is_same_v<T, ISD::OutputArg> ||
> - std::is_same_v<T, ISD::InputArg>,
> + static_assert(std::is_same<T, ISD::OutputArg>::value ||
> + std::is_same<T, ISD::InputArg>::value,
> "requires ISD::OutputArg or ISD::InputArg");
>
> // Only 32-bit pops the sret. It's a 64-bit world these days, so early-out
>
> diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
> index ab6c28c803795..6dca30d9876e2 100644
> --- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
> +++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
> @@ -576,13 +576,13 @@ NaryReassociatePass::findClosestMatchingDominator(const SCEV *CandidateExpr,
> }
>
> template <typename MaxMinT> static SCEVTypes convertToSCEVype(MaxMinT &MM) {
> - if (std::is_same_v<smax_pred_ty, typename MaxMinT::PredType>)
> + if (std::is_same<smax_pred_ty, typename MaxMinT::PredType>::value)
> return scSMaxExpr;
> - else if (std::is_same_v<umax_pred_ty, typename MaxMinT::PredType>)
> + else if (std::is_same<umax_pred_ty, typename MaxMinT::PredType>::value)
> return scUMaxExpr;
> - else if (std::is_same_v<smin_pred_ty, typename MaxMinT::PredType>)
> + else if (std::is_same<smin_pred_ty, typename MaxMinT::PredType>::value)
> return scSMinExpr;
> - else if (std::is_same_v<umin_pred_ty, typename MaxMinT::PredType>)
> + else if (std::is_same<umin_pred_ty, typename MaxMinT::PredType>::value)
> return scUMinExpr;
>
> llvm_unreachable("Can't convert MinMax pattern to SCEV type");
>
> diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> index eb22d9f19e049..ecfaabee59f46 100644
> --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> @@ -7219,11 +7219,12 @@ namespace {
> /// value, otherwise.
> struct ValueSelect {
> template <typename U>
> - static std::enable_if_t<std::is_same_v<Value *, U>, Value *> get(Value *V) {
> + static std::enable_if_t<std::is_same<Value *, U>::value, Value *>
> + get(Value *V) {
> return V;
> }
> template <typename U>
> - static std::enable_if_t<!std::is_same_v<Value *, U>, U> get(Value *) {
> + static std::enable_if_t<!std::is_same<Value *, U>::value, U> get(Value *) {
> return U();
> }
> };
>
> diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
> index d3760a9ac30f9..5fec8475f5eef 100644
> --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
> +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
> @@ -256,8 +256,8 @@ class NewArchiveMemberList {
> "This test makes sure NewArchiveMemberList is used by MembersData since "
> "the following asserts test invariants required for MembersData.");
> static_assert(
> - !std::is_copy_constructible_v<
> - decltype(NewArchiveMemberList::Members)::value_type>,
> + !std::is_copy_constructible<
> + decltype(NewArchiveMemberList::Members)::value_type>::value,
> "MembersData::MembersPerArchitecture has a dependency on "
> "MembersData::FileBuffers so it should not be able to "
> "be copied on its own without FileBuffers. Unfortunately, "
> @@ -265,8 +265,8 @@ class NewArchiveMemberList {
> "of a non-copyable type is itself non-copyable so we have to test the "
> "actual type of the stored data (ie, value_type).");
> static_assert(
> - !std::is_copy_assignable_v<
> - decltype(NewArchiveMemberList::Members)::value_type>,
> + !std::is_copy_assignable<
> + decltype(NewArchiveMemberList::Members)::value_type>::value,
> "MembersData::MembersPerArchitecture has a dependency on "
> "MembersData::FileBuffers so it should not be able to "
> "be copied on its own without FileBuffers. Unfortunately, "
>
> diff --git a/llvm/unittests/ADT/ArrayRefTest.cpp b/llvm/unittests/ADT/ArrayRefTest.cpp
> index 9fcddc88e69f1..eded12d37bb7d 100644
> --- a/llvm/unittests/ADT/ArrayRefTest.cpp
> +++ b/llvm/unittests/ADT/ArrayRefTest.cpp
> @@ -16,27 +16,34 @@ using namespace llvm;
>
> // Check that the ArrayRef-of-pointer converting constructor only allows adding
> // cv qualifiers (not removing them, or otherwise changing the type)
> -static_assert(std::is_convertible_v<ArrayRef<int *>, ArrayRef<const int *>>,
> - "Adding const");
> -static_assert(std::is_convertible_v<ArrayRef<int *>, ArrayRef<volatile int *>>,
> - "Adding volatile");
> -static_assert(!std::is_convertible_v<ArrayRef<int *>, ArrayRef<float *>>,
> +static_assert(
> + std::is_convertible<ArrayRef<int *>, ArrayRef<const int *>>::value,
> + "Adding const");
> +static_assert(
> + std::is_convertible<ArrayRef<int *>, ArrayRef<volatile int *>>::value,
> + "Adding volatile");
> +static_assert(!std::is_convertible<ArrayRef<int *>, ArrayRef<float *>>::value,
> "Changing pointer of one type to a pointer of another");
> -static_assert(!std::is_convertible_v<ArrayRef<const int *>, ArrayRef<int *>>,
> - "Removing const");
> -static_assert(!std::is_convertible_v<ArrayRef<volatile int *>, ArrayRef<int *>>,
> - "Removing volatile");
> +static_assert(
> + !std::is_convertible<ArrayRef<const int *>, ArrayRef<int *>>::value,
> + "Removing const");
> +static_assert(
> + !std::is_convertible<ArrayRef<volatile int *>, ArrayRef<int *>>::value,
> + "Removing volatile");
>
> // Check that we can't accidentally assign a temporary location to an ArrayRef.
> // (Unfortunately we can't make use of the same thing with constructors.)
> -static_assert(!std::is_assignable_v<ArrayRef<int *> &, int *>,
> - "Assigning from single prvalue element");
> -static_assert(!std::is_assignable_v<ArrayRef<int *> &, int *&&>,
> - "Assigning from single xvalue element");
> -static_assert(std::is_assignable_v<ArrayRef<int *> &, int *&>,
> - "Assigning from single lvalue element");
> static_assert(
> - !std::is_assignable_v<ArrayRef<int *> &, std::initializer_list<int *>>,
> + !std::is_assignable<ArrayRef<int *>&, int *>::value,
> + "Assigning from single prvalue element");
> +static_assert(
> + !std::is_assignable<ArrayRef<int *>&, int * &&>::value,
> + "Assigning from single xvalue element");
> +static_assert(
> + std::is_assignable<ArrayRef<int *>&, int * &>::value,
> + "Assigning from single lvalue element");
> +static_assert(
> + !std::is_assignable<ArrayRef<int *>&, std::initializer_list<int *>>::value,
> "Assigning from an initializer list");
>
> namespace {
> @@ -254,7 +261,7 @@ TEST(ArrayRefTest, makeArrayRefFromStdArray) {
> }
> }
>
> -static_assert(std::is_trivially_copyable_v<ArrayRef<int>>,
> +static_assert(std::is_trivially_copyable<ArrayRef<int>>::value,
> "trivially copyable");
>
> TEST(ArrayRefTest, makeMutableArrayRef) {
>
> diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp
> index 6893f439b46f4..cb77ad887ba15 100644
> --- a/llvm/unittests/ADT/DenseMapTest.cpp
> +++ b/llvm/unittests/ADT/DenseMapTest.cpp
> @@ -682,7 +682,7 @@ struct B : public A {
>
> namespace llvm {
> template <typename T>
> -struct DenseMapInfo<T, std::enable_if_t<std::is_base_of_v<A, T>>> {
> +struct DenseMapInfo<T, std::enable_if_t<std::is_base_of<A, T>::value>> {
> static inline T getEmptyKey() { return {static_cast<int>(~0)}; }
> static inline T getTombstoneKey() { return {static_cast<int>(~0U - 1)}; }
> static unsigned getHashValue(const T &Val) { return Val.value; }
>
> diff --git a/llvm/unittests/ADT/DenseSetTest.cpp b/llvm/unittests/ADT/DenseSetTest.cpp
> index f14542eafc251..82ac1d8bff0f2 100644
> --- a/llvm/unittests/ADT/DenseSetTest.cpp
> +++ b/llvm/unittests/ADT/DenseSetTest.cpp
> @@ -14,14 +14,12 @@ using namespace llvm;
>
> namespace {
>
> -static_assert(
> - std::is_const_v<
> - std::remove_pointer_t<DenseSet<int>::const_iterator::pointer>>,
> - "Iterator pointer type should be const");
> -static_assert(
> - std::is_const_v<
> - std::remove_reference_t<DenseSet<int>::const_iterator::reference>>,
> - "Iterator reference type should be const");
> +static_assert(std::is_const<std::remove_pointer<
> + DenseSet<int>::const_iterator::pointer>::type>::value,
> + "Iterator pointer type should be const");
> +static_assert(std::is_const<std::remove_reference<
> + DenseSet<int>::const_iterator::reference>::type>::value,
> + "Iterator reference type should be const");
>
> // Test hashing with a set of only two entries.
> TEST(DenseSetTest, DoubleEntrySetTest) {
>
> diff --git a/llvm/unittests/ADT/EnumeratedArrayTest.cpp b/llvm/unittests/ADT/EnumeratedArrayTest.cpp
> index a978ce4ab99b7..9975428047141 100644
> --- a/llvm/unittests/ADT/EnumeratedArrayTest.cpp
> +++ b/llvm/unittests/ADT/EnumeratedArrayTest.cpp
> @@ -106,15 +106,15 @@ enum class Colors { Red, Blue, Green, Last = Green };
>
> using Array = EnumeratedArray<float, Colors, Colors::Last, size_t>;
>
> -static_assert(std::is_same_v<Array::value_type, float>,
> +static_assert(std::is_same<Array::value_type, float>::value,
> "Incorrect value_type type");
> -static_assert(std::is_same_v<Array::reference, float &>,
> +static_assert(std::is_same<Array::reference, float &>::value,
> "Incorrect reference type!");
> -static_assert(std::is_same_v<Array::pointer, float *>,
> +static_assert(std::is_same<Array::pointer, float *>::value,
> "Incorrect pointer type!");
> -static_assert(std::is_same_v<Array::const_reference, const float &>,
> +static_assert(std::is_same<Array::const_reference, const float &>::value,
> "Incorrect const_reference type!");
> -static_assert(std::is_same_v<Array::const_pointer, const float *>,
> +static_assert(std::is_same<Array::const_pointer, const float *>::value,
> "Incorrect const_pointer type!");
> } // namespace
>
>
> diff --git a/llvm/unittests/ADT/IListIteratorTest.cpp b/llvm/unittests/ADT/IListIteratorTest.cpp
> index bd638a8e22b22..559e32de077c5 100644
> --- a/llvm/unittests/ADT/IListIteratorTest.cpp
> +++ b/llvm/unittests/ADT/IListIteratorTest.cpp
> @@ -158,14 +158,16 @@ TEST(IListIteratorTest, ReverseConstructor) {
> EXPECT_EQ(CL.rbegin(), const_reverse_iterator(CL.end()));
>
> // Confirm lack of implicit conversions.
> - static_assert(!std::is_convertible_v<iterator, reverse_iterator>,
> + static_assert(!std::is_convertible<iterator, reverse_iterator>::value,
> "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<reverse_iterator, iterator>,
> - "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<const_iterator, const_reverse_iterator>,
> - "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<const_reverse_iterator, const_iterator>,
> + static_assert(!std::is_convertible<reverse_iterator, iterator>::value,
> "unexpected implicit conversion");
> + static_assert(
> + !std::is_convertible<const_iterator, const_reverse_iterator>::value,
> + "unexpected implicit conversion");
> + static_assert(
> + !std::is_convertible<const_reverse_iterator, const_iterator>::value,
> + "unexpected implicit conversion");
> }
>
> } // end namespace
>
> diff --git a/llvm/unittests/ADT/IListNodeTest.cpp b/llvm/unittests/ADT/IListNodeTest.cpp
> index 057eabb4e4ab7..cf775eb5d0699 100644
> --- a/llvm/unittests/ADT/IListNodeTest.cpp
> +++ b/llvm/unittests/ADT/IListNodeTest.cpp
> @@ -22,46 +22,47 @@ struct TagB {};
>
> TEST(IListNodeTest, Options) {
> static_assert(
> - std::is_same_v<compute_node_options<Node>::type,
> - compute_node_options<Node, ilist_tag<void>>::type>,
> + std::is_same<compute_node_options<Node>::type,
> + compute_node_options<Node, ilist_tag<void>>::type>::value,
> "default tag is void");
> static_assert(
> - !std::is_same_v<compute_node_options<Node, ilist_tag<TagA>>::type,
> - compute_node_options<Node, ilist_tag<void>>::type>,
> + !std::is_same<compute_node_options<Node, ilist_tag<TagA>>::type,
> + compute_node_options<Node, ilist_tag<void>>::type>::value,
> "default tag is void,
> diff erent from TagA");
> static_assert(
> - !std::is_same_v<compute_node_options<Node, ilist_tag<TagA>>::type,
> - compute_node_options<Node, ilist_tag<TagB>>::type>,
> + !std::is_same<compute_node_options<Node, ilist_tag<TagA>>::type,
> + compute_node_options<Node, ilist_tag<TagB>>::type>::value,
> "TagA is not TagB");
> static_assert(
> - std::is_same_v<
> + std::is_same<
> compute_node_options<Node, ilist_sentinel_tracking<false>>::type,
> compute_node_options<Node, ilist_sentinel_tracking<false>,
> - ilist_tag<void>>::type>,
> + ilist_tag<void>>::type>::value,
> "default tag is void, even with sentinel tracking off");
> static_assert(
> - std::is_same_v<
> + std::is_same<
> compute_node_options<Node, ilist_sentinel_tracking<false>>::type,
> compute_node_options<Node, ilist_tag<void>,
> - ilist_sentinel_tracking<false>>::type>,
> + ilist_sentinel_tracking<false>>::type>::value,
> "order shouldn't matter");
> static_assert(
> - std::is_same_v<
> + std::is_same<
> compute_node_options<Node, ilist_sentinel_tracking<true>>::type,
> compute_node_options<Node, ilist_sentinel_tracking<true>,
> - ilist_tag<void>>::type>,
> + ilist_tag<void>>::type>::value,
> "default tag is void, even with sentinel tracking on");
> static_assert(
> - std::is_same_v<
> + std::is_same<
> compute_node_options<Node, ilist_sentinel_tracking<true>>::type,
> compute_node_options<Node, ilist_tag<void>,
> - ilist_sentinel_tracking<true>>::type>,
> + ilist_sentinel_tracking<true>>::type>::value,
> "order shouldn't matter");
> static_assert(
> - std::is_same_v<compute_node_options<Node, ilist_sentinel_tracking<true>,
> - ilist_tag<TagA>>::type,
> - compute_node_options<Node, ilist_tag<TagA>,
> - ilist_sentinel_tracking<true>>::type>,
> + std::is_same<
> + compute_node_options<Node, ilist_sentinel_tracking<true>,
> + ilist_tag<TagA>>::type,
> + compute_node_options<Node, ilist_tag<TagA>,
> + ilist_sentinel_tracking<true>>::type>::value,
> "order shouldn't matter with real tags");
> }
>
>
> diff --git a/llvm/unittests/ADT/ImmutableListTest.cpp b/llvm/unittests/ADT/ImmutableListTest.cpp
> index 2da0ca65d1a4f..28624c0d551d4 100644
> --- a/llvm/unittests/ADT/ImmutableListTest.cpp
> +++ b/llvm/unittests/ADT/ImmutableListTest.cpp
> @@ -266,7 +266,7 @@ TEST_F(ImmutableListTest, LongListOrderingTest) {
> ASSERT_EQ(6, i);
> }
>
> -static_assert(std::is_trivially_copyable_v<ImmutableList<Wrapper<long>>>,
> +static_assert(std::is_trivially_copyable<ImmutableList<Wrapper<long>>>::value,
> "trivially copyable");
>
> } // namespace
>
> diff --git a/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp b/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
> index 45b8028aef200..e4b649837f6f0 100644
> --- a/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
> +++ b/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp
> @@ -101,22 +101,24 @@ TEST(IntrusiveRefCntPtr, UsesTraitsToRetainAndRelease) {
> struct X : RefCountedBase<X> {};
> struct Y : X {};
> struct Z : RefCountedBase<Z> {};
> -static_assert(
> - !std::is_convertible_v<IntrusiveRefCntPtr<X> &&, IntrusiveRefCntPtr<Y>>,
> - "X&& -> Y should be rejected with SFINAE");
> -static_assert(!std::is_convertible_v<const IntrusiveRefCntPtr<X> &,
> - IntrusiveRefCntPtr<Y>>,
> +static_assert(!std::is_convertible<IntrusiveRefCntPtr<X> &&,
> + IntrusiveRefCntPtr<Y>>::value,
> + "X&& -> Y should be rejected with SFINAE");
> +static_assert(!std::is_convertible<const IntrusiveRefCntPtr<X> &,
> + IntrusiveRefCntPtr<Y>>::value,
> "const X& -> Y should be rejected with SFINAE");
> -static_assert(!std::is_convertible_v<std::unique_ptr<X>, IntrusiveRefCntPtr<Y>>,
> - "X -> Y should be rejected with SFINAE");
> static_assert(
> - !std::is_convertible_v<IntrusiveRefCntPtr<X> &&, IntrusiveRefCntPtr<Z>>,
> - "X&& -> Z should be rejected with SFINAE");
> -static_assert(!std::is_convertible_v<const IntrusiveRefCntPtr<X> &,
> - IntrusiveRefCntPtr<Z>>,
> + !std::is_convertible<std::unique_ptr<X>, IntrusiveRefCntPtr<Y>>::value,
> + "X -> Y should be rejected with SFINAE");
> +static_assert(!std::is_convertible<IntrusiveRefCntPtr<X> &&,
> + IntrusiveRefCntPtr<Z>>::value,
> + "X&& -> Z should be rejected with SFINAE");
> +static_assert(!std::is_convertible<const IntrusiveRefCntPtr<X> &,
> + IntrusiveRefCntPtr<Z>>::value,
> "const X& -> Z should be rejected with SFINAE");
> -static_assert(!std::is_convertible_v<std::unique_ptr<X>, IntrusiveRefCntPtr<Z>>,
> - "X -> Z should be rejected with SFINAE");
> +static_assert(
> + !std::is_convertible<std::unique_ptr<X>, IntrusiveRefCntPtr<Z>>::value,
> + "X -> Z should be rejected with SFINAE");
>
> TEST(IntrusiveRefCntPtr, InteropsWithConvertible) {
> // Check converting constructors and operator=.
>
> diff --git a/llvm/unittests/ADT/IteratorTest.cpp b/llvm/unittests/ADT/IteratorTest.cpp
> index dd487c1be03b2..7269bfc4b6fb0 100644
> --- a/llvm/unittests/ADT/IteratorTest.cpp
> +++ b/llvm/unittests/ADT/IteratorTest.cpp
> @@ -27,11 +27,14 @@ struct AdaptedIter : iterator_adaptor_base<AdaptedIter, WeirdIter> {};
>
> // Test that iterator_adaptor_base forwards typedefs, if value_type is
> // unchanged.
> -static_assert(std::is_same_v<typename AdaptedIter::value_type, Shadow<0>>, "");
> -static_assert(std::is_same_v<typename AdaptedIter::
> diff erence_type, Shadow<1>>,
> +static_assert(std::is_same<typename AdaptedIter::value_type, Shadow<0>>::value,
> + "");
> +static_assert(
> + std::is_same<typename AdaptedIter::
> diff erence_type, Shadow<1>>::value, "");
> +static_assert(std::is_same<typename AdaptedIter::pointer, Shadow<2>>::value,
> + "");
> +static_assert(std::is_same<typename AdaptedIter::reference, Shadow<3>>::value,
> "");
> -static_assert(std::is_same_v<typename AdaptedIter::pointer, Shadow<2>>, "");
> -static_assert(std::is_same_v<typename AdaptedIter::reference, Shadow<3>>, "");
>
> // Ensure that pointe{e,r}_iterator adaptors correctly forward the category of
> // the underlying iterator.
> @@ -84,12 +87,13 @@ static_assert(&IntIterator::operator* == &IntIterator::operator*, "");
> static_assert(&IntIterator::operator-> == &IntIterator::operator->, "");
> static_assert(&IntIterator::operator[] == &IntIterator::operator[], "");
>
> -template <class T, std::enable_if_t<std::is_assignable_v<T, int>, bool> = false>
> +template <class T,
> + std::enable_if_t<std::is_assignable<T, int>::value, bool> = false>
> constexpr bool canAssignFromInt(T &&) {
> return true;
> }
> template <class T,
> - std::enable_if_t<!std::is_assignable_v<T, int>, bool> = false>
> + std::enable_if_t<!std::is_assignable<T, int>::value, bool> = false>
> constexpr bool canAssignFromInt(T &&) {
> return false;
> }
> @@ -139,17 +143,15 @@ TEST(IteratorAdaptorTest, Dereference) {
> }
>
> // pointeE_iterator
> -static_assert(
> - IsAdaptedIterCategorySame_v<pointee_iterator_defaulted, RandomAccessIter>,
> - "");
> -static_assert(IsAdaptedIterCategorySame_v<pointee_iterator_defaulted, BidiIter>,
> - "");
> +static_assert(IsAdaptedIterCategorySame<pointee_iterator_defaulted,
> + RandomAccessIter>::value, "");
> +static_assert(IsAdaptedIterCategorySame<pointee_iterator_defaulted,
> + BidiIter>::value, "");
> // pointeR_iterator
> -static_assert(
> - IsAdaptedIterCategorySame_v<pointer_iterator_defaulted, RandomAccessIter>,
> - "");
> -static_assert(IsAdaptedIterCategorySame_v<pointer_iterator_defaulted, BidiIter>,
> - "");
> +static_assert(IsAdaptedIterCategorySame<pointer_iterator_defaulted,
> + RandomAccessIter>::value, "");
> +static_assert(IsAdaptedIterCategorySame<pointer_iterator_defaulted,
> + BidiIter>::value, "");
>
> TEST(PointeeIteratorTest, Basic) {
> int arr[4] = {1, 2, 3, 4};
>
> diff --git a/llvm/unittests/ADT/OptionalTest.cpp b/llvm/unittests/ADT/OptionalTest.cpp
> index 5f1f88d107399..e615d56e2b625 100644
> --- a/llvm/unittests/ADT/OptionalTest.cpp
> +++ b/llvm/unittests/ADT/OptionalTest.cpp
> @@ -18,10 +18,10 @@
>
> using namespace llvm;
>
> -static_assert(std::is_trivially_copyable_v<Optional<int>>,
> +static_assert(std::is_trivially_copyable<Optional<int>>::value,
> "trivially copyable");
>
> -static_assert(std::is_trivially_copyable_v<Optional<std::array<int, 3>>>,
> +static_assert(std::is_trivially_copyable<Optional<std::array<int, 3>>>::value,
> "trivially copyable");
>
> void OptionalWorksInConstexpr() {
> @@ -70,8 +70,9 @@ unsigned NonDefaultConstructible::CopyConstructions = 0;
> unsigned NonDefaultConstructible::Destructions = 0;
> unsigned NonDefaultConstructible::CopyAssignments = 0;
>
> -static_assert(!std::is_trivially_copyable_v<Optional<NonDefaultConstructible>>,
> - "not trivially copyable");
> +static_assert(
> + !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
> + "not trivially copyable");
>
> TEST(OptionalTest, NonDefaultConstructibleTest) {
> Optional<NonDefaultConstructible> O;
> @@ -240,7 +241,7 @@ struct MultiArgConstructor {
> };
> unsigned MultiArgConstructor::Destructions = 0;
>
> -static_assert(!std::is_trivially_copyable_v<Optional<MultiArgConstructor>>,
> +static_assert(!std::is_trivially_copyable<Optional<MultiArgConstructor>>::value,
> "not trivially copyable");
>
> TEST(OptionalTest, Emplace) {
> @@ -322,7 +323,7 @@ unsigned MoveOnly::MoveConstructions = 0;
> unsigned MoveOnly::Destructions = 0;
> unsigned MoveOnly::MoveAssignments = 0;
>
> -static_assert(!std::is_trivially_copyable_v<Optional<MoveOnly>>,
> +static_assert(!std::is_trivially_copyable<Optional<MoveOnly>>::value,
> "not trivially copyable");
>
> TEST(OptionalTest, MoveOnlyNull) {
> @@ -426,7 +427,7 @@ struct Immovable {
> unsigned Immovable::Constructions = 0;
> unsigned Immovable::Destructions = 0;
>
> -static_assert(!std::is_trivially_copyable_v<Optional<Immovable>>,
> +static_assert(!std::is_trivially_copyable<Optional<Immovable>>::value,
> "not trivially copyable");
>
> TEST(OptionalTest, ImmovableEmplace) {
> @@ -564,7 +565,7 @@ TEST(OptionalTest, DeletedMoveConstructor) {
> NonTMove1 = std::move(NonTMove2);
>
> static_assert(
> - std::is_trivially_copyable_v<NoTMoveOptT>,
> + std::is_trivially_copyable<NoTMoveOptT>::value,
> "Expect Optional<NoTMove> to still use the trivial specialization "
> "of OptionalStorage despite the deleted move constructor / assignment.");
> }
>
> diff --git a/llvm/unittests/ADT/PointerIntPairTest.cpp b/llvm/unittests/ADT/PointerIntPairTest.cpp
> index 9e5e0ee1614be..8a42e5b9f5571 100644
> --- a/llvm/unittests/ADT/PointerIntPairTest.cpp
> +++ b/llvm/unittests/ADT/PointerIntPairTest.cpp
> @@ -62,7 +62,7 @@ TEST(PointerIntPairTest, GetSet) {
> EXPECT_EQ(&s, Pair2.getPointer());
> EXPECT_EQ(E::Case3, Pair2.getInt());
>
> - static_assert(std::is_trivially_copyable_v<PointerIntPair<S *, 2, E>>,
> + static_assert(std::is_trivially_copyable<PointerIntPair<S *, 2, E>>::value,
> "trivially copyable");
> }
>
> @@ -100,9 +100,10 @@ TEST(PointerIntPairTest, ManyUnusedBits) {
> EXPECT_EQ(FixnumPointerTraits::NumLowBitsAvailable - 1,
> (int)PointerLikeTypeTraits<decltype(pair)>::NumLowBitsAvailable);
>
> - static_assert(std::is_trivially_copyable_v<
> - PointerIntPair<Fixnum31, 1, bool, FixnumPointerTraits>>,
> - "trivially copyable");
> + static_assert(
> + std::is_trivially_copyable<
> + PointerIntPair<Fixnum31, 1, bool, FixnumPointerTraits>>::value,
> + "trivially copyable");
> }
>
> } // end anonymous namespace
>
> diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp
> index 43ab6a97cffdd..180ae45931ccb 100644
> --- a/llvm/unittests/ADT/PointerUnionTest.cpp
> +++ b/llvm/unittests/ADT/PointerUnionTest.cpp
> @@ -279,13 +279,13 @@ TEST_F(PointerUnionTest, NewCastInfra) {
> EXPECT_EQ(dyn_cast<long long *>(constd4), nullptr);
>
> auto *result1 = cast<double *>(constd4);
> - static_assert(std::is_same_v<double *, decltype(result1)>,
> + static_assert(std::is_same<double *, decltype(result1)>::value,
> "type mismatch for cast with PointerUnion");
>
> PointerUnion<int *, const double *> constd2(&d);
> auto *result2 = cast<const double *>(constd2);
> EXPECT_EQ(result2, &d);
> - static_assert(std::is_same_v<const double *, decltype(result2)>,
> + static_assert(std::is_same<const double *, decltype(result2)>::value,
> "type mismatch for cast with PointerUnion");
> }
>
>
> diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
> index 62e6f4339f94a..e7ac9c0d76fdd 100644
> --- a/llvm/unittests/ADT/SmallVectorTest.cpp
> +++ b/llvm/unittests/ADT/SmallVectorTest.cpp
> @@ -1229,7 +1229,7 @@ class SmallVectorReferenceInvalidationTest : public SmallVectorTestBase {
> VectorT V;
>
> template <class T> static bool isValueType() {
> - return std::is_same_v<T, typename VectorT::value_type>;
> + return std::is_same<T, typename VectorT::value_type>::value;
> }
>
> void SetUp() override {
>
> diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
> index 4ea1ea5455185..3827ebeb23980 100644
> --- a/llvm/unittests/ADT/StringRefTest.cpp
> +++ b/llvm/unittests/ADT/StringRefTest.cpp
> @@ -34,18 +34,24 @@ std::ostream &operator<<(std::ostream &OS,
> // Check that we can't accidentally assign a temporary std::string to a
> // StringRef. (Unfortunately we can't make use of the same thing with
> // constructors.)
> -static_assert(!std::is_assignable_v<StringRef &, std::string>,
> - "Assigning from prvalue std::string");
> -static_assert(!std::is_assignable_v<StringRef &, std::string &&>,
> - "Assigning from xvalue std::string");
> -static_assert(std::is_assignable_v<StringRef &, std::string &>,
> - "Assigning from lvalue std::string");
> -static_assert(std::is_assignable_v<StringRef &, const char *>,
> - "Assigning from prvalue C string");
> -static_assert(std::is_assignable_v<StringRef &, const char *&&>,
> - "Assigning from xvalue C string");
> -static_assert(std::is_assignable_v<StringRef &, const char *&>,
> - "Assigning from lvalue C string");
> +static_assert(
> + !std::is_assignable<StringRef&, std::string>::value,
> + "Assigning from prvalue std::string");
> +static_assert(
> + !std::is_assignable<StringRef&, std::string &&>::value,
> + "Assigning from xvalue std::string");
> +static_assert(
> + std::is_assignable<StringRef&, std::string &>::value,
> + "Assigning from lvalue std::string");
> +static_assert(
> + std::is_assignable<StringRef&, const char *>::value,
> + "Assigning from prvalue C string");
> +static_assert(
> + std::is_assignable<StringRef&, const char * &&>::value,
> + "Assigning from xvalue C string");
> +static_assert(
> + std::is_assignable<StringRef&, const char * &>::value,
> + "Assigning from lvalue C string");
>
> namespace {
> TEST(StringRefTest, Construction) {
> @@ -1138,6 +1144,7 @@ TEST(StringRefTest, LFCRLineEnding) {
> EXPECT_EQ(StringRef("\n\r"), Cases[2].detectEOL());
> }
>
> -static_assert(std::is_trivially_copyable_v<StringRef>, "trivially copyable");
> +static_assert(std::is_trivially_copyable<StringRef>::value,
> + "trivially copyable");
>
> } // end anonymous namespace
>
> diff --git a/llvm/unittests/ADT/TypeTraitsTest.cpp b/llvm/unittests/ADT/TypeTraitsTest.cpp
> index a56aa7e98cfe0..30fb98a3f2f54 100644
> --- a/llvm/unittests/ADT/TypeTraitsTest.cpp
> +++ b/llvm/unittests/ADT/TypeTraitsTest.cpp
> @@ -19,11 +19,11 @@ namespace {
> /// Check a callable type of the form `bool(const int &)`.
> template <typename CallableT> struct CheckFunctionTraits {
> static_assert(
> - std::is_same_v<typename function_traits<CallableT>::result_t, bool>,
> + std::is_same<typename function_traits<CallableT>::result_t, bool>::value,
> "expected result_t to be `bool`");
> static_assert(
> - std::is_same_v<typename function_traits<CallableT>::template arg_t<0>,
> - const int &>,
> + std::is_same<typename function_traits<CallableT>::template arg_t<0>,
> + const int &>::value,
> "expected arg_t<0> to be `const int &`");
> static_assert(function_traits<CallableT>::num_args == 1,
> "expected num_args to be 1");
>
> diff --git a/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp b/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
> index 91621287c8a9b..91009ab7d074f 100644
> --- a/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
> +++ b/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
> @@ -91,7 +91,7 @@ TEST_F(BlockFrequencyInfoTest, Basic) {
> EXPECT_EQ(BFI.getBlockFreq(BB3).getFrequency(), BB3Freq);
> }
>
> -static_assert(std::is_trivially_copyable_v<bfi_detail::BlockMass>,
> +static_assert(std::is_trivially_copyable<bfi_detail::BlockMass>::value,
> "trivially copyable");
>
> } // end anonymous namespace
>
> diff --git a/llvm/unittests/Analysis/CallGraphTest.cpp b/llvm/unittests/Analysis/CallGraphTest.cpp
> index 566733f10c8a9..0060d2c4b2396 100644
> --- a/llvm/unittests/Analysis/CallGraphTest.cpp
> +++ b/llvm/unittests/Analysis/CallGraphTest.cpp
> @@ -23,11 +23,11 @@ template <typename Ty> void canSpecializeGraphTraitsIterators(Ty *G) {
> auto X = ++I;
>
> // Should be able to iterate over all nodes of the graph.
> - static_assert(std::is_same_v<decltype(*I), NodeRef>,
> + static_assert(std::is_same<decltype(*I), NodeRef>::value,
> "Node type does not match");
> - static_assert(std::is_same_v<decltype(*X), NodeRef>,
> + static_assert(std::is_same<decltype(*X), NodeRef>::value,
> "Node type does not match");
> - static_assert(std::is_same_v<decltype(*E), NodeRef>,
> + static_assert(std::is_same<decltype(*E), NodeRef>::value,
> "Node type does not match");
>
> NodeRef N = GraphTraits<Ty *>::getEntryNode(G);
> @@ -36,9 +36,9 @@ template <typename Ty> void canSpecializeGraphTraitsIterators(Ty *G) {
> auto F = GraphTraits<NodeRef>::child_end(N);
>
> // Should be able to iterate over immediate successors of a node.
> - static_assert(std::is_same_v<decltype(*S), NodeRef>,
> + static_assert(std::is_same<decltype(*S), NodeRef>::value,
> "Node type does not match");
> - static_assert(std::is_same_v<decltype(*F), NodeRef>,
> + static_assert(std::is_same<decltype(*F), NodeRef>::value,
> "Node type does not match");
> }
>
>
> diff --git a/llvm/unittests/Bitstream/BitstreamReaderTest.cpp b/llvm/unittests/Bitstream/BitstreamReaderTest.cpp
> index f9056f00a2133..669288e426476 100644
> --- a/llvm/unittests/Bitstream/BitstreamReaderTest.cpp
> +++ b/llvm/unittests/Bitstream/BitstreamReaderTest.cpp
> @@ -161,7 +161,7 @@ TEST(BitstreamReaderTest, shortRead) {
> }
> }
>
> -static_assert(std::is_trivially_copyable_v<BitCodeAbbrevOp>,
> +static_assert(std::is_trivially_copyable<BitCodeAbbrevOp>::value,
> "trivially copyable");
>
> } // end anonymous namespace
>
> diff --git a/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp b/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
> index b583856fb559a..5ce0983ae3cdc 100644
> --- a/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
> +++ b/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
> @@ -181,14 +181,16 @@ TEST(MachineInstrBundleIteratorTest, ReverseConstructor) {
> EXPECT_EQ(crbegin(), const_reverse_iterator(cend()));
>
> // Confirm lack of implicit conversions.
> - static_assert(!std::is_convertible_v<iterator, reverse_iterator>,
> + static_assert(!std::is_convertible<iterator, reverse_iterator>::value,
> "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<reverse_iterator, iterator>,
> - "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<const_iterator, const_reverse_iterator>,
> - "unexpected implicit conversion");
> - static_assert(!std::is_convertible_v<const_reverse_iterator, const_iterator>,
> + static_assert(!std::is_convertible<reverse_iterator, iterator>::value,
> "unexpected implicit conversion");
> + static_assert(
> + !std::is_convertible<const_iterator, const_reverse_iterator>::value,
> + "unexpected implicit conversion");
> + static_assert(
> + !std::is_convertible<const_reverse_iterator, const_iterator>::value,
> + "unexpected implicit conversion");
> }
>
> } // end namespace
>
> diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp
> index 19e46075dbae4..6488f24e54a8a 100644
> --- a/llvm/unittests/CodeGen/MachineInstrTest.cpp
> +++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp
> @@ -472,6 +472,7 @@ TEST(MachineInstrBuilder, BuildMI) {
> EXPECT_THAT(BuildMI(MBB, MIMD, MCID), HasMIMetadata(MIMD));
> }
>
> -static_assert(std::is_trivially_copyable_v<MCOperand>, "trivially copyable");
> +static_assert(std::is_trivially_copyable<MCOperand>::value,
> + "trivially copyable");
>
> } // end namespace
>
> diff --git a/llvm/unittests/CodeGen/TypeTraitsTest.cpp b/llvm/unittests/CodeGen/TypeTraitsTest.cpp
> index 0ca4fa4e82c7c..af1f36c1e9454 100644
> --- a/llvm/unittests/CodeGen/TypeTraitsTest.cpp
> +++ b/llvm/unittests/CodeGen/TypeTraitsTest.cpp
> @@ -17,12 +17,13 @@
> using namespace llvm;
>
> #if __has_feature(is_trivially_copyable) || (defined(__GNUC__) && __GNUC__ >= 5)
> -static_assert(std::is_trivially_copyable_v<PressureChange>,
> +static_assert(std::is_trivially_copyable<PressureChange>::value,
> "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<SDep>, "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<SDValue>, "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<SlotIndex>, "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<IdentifyingPassPtr>,
> +static_assert(std::is_trivially_copyable<SDep>::value, "trivially copyable");
> +static_assert(std::is_trivially_copyable<SDValue>::value, "trivially copyable");
> +static_assert(std::is_trivially_copyable<SlotIndex>::value,
> + "trivially copyable");
> +static_assert(std::is_trivially_copyable<IdentifyingPassPtr>::value,
> "trivially copyable");
> #endif
>
>
> diff --git a/llvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp b/llvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp
> index 6c441a31882a6..ee73614d53d44 100644
> --- a/llvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp
> +++ b/llvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp
> @@ -67,7 +67,7 @@ static void spsSerializationRoundTrip(const T &Value) {
> template <typename T> static void testFixedIntegralTypeSerialization() {
> spsSerializationRoundTrip<T, T>(0);
> spsSerializationRoundTrip<T, T>(static_cast<T>(1));
> - if (std::is_signed_v<T>) {
> + if (std::is_signed<T>::value) {
> spsSerializationRoundTrip<T, T>(static_cast<T>(-1));
> spsSerializationRoundTrip<T, T>(std::numeric_limits<T>::min());
> }
>
> diff --git a/llvm/unittests/IR/CFGBuilder.cpp b/llvm/unittests/IR/CFGBuilder.cpp
> index cede196d250aa..c9bc52ca7a66a 100644
> --- a/llvm/unittests/IR/CFGBuilder.cpp
> +++ b/llvm/unittests/IR/CFGBuilder.cpp
> @@ -267,10 +267,11 @@ TEST(CFGBuilder, Rebuild) {
> EXPECT_TRUE(isa<SwitchInst>(B.getOrAddBlock("d")->getTerminator()));
> }
>
> -static_assert(std::is_trivially_copyable_v<succ_iterator>,
> +static_assert(std::is_trivially_copyable<succ_iterator>::value,
> "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<const_succ_iterator>,
> +static_assert(std::is_trivially_copyable<const_succ_iterator>::value,
> "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<succ_range>, "trivially copyable");
> -static_assert(std::is_trivially_copyable_v<const_succ_range>,
> +static_assert(std::is_trivially_copyable<succ_range>::value,
> + "trivially copyable");
> +static_assert(std::is_trivially_copyable<const_succ_range>::value,
> "trivially copyable");
>
> diff --git a/llvm/unittests/IR/DominatorTreeBatchUpdatesTest.cpp b/llvm/unittests/IR/DominatorTreeBatchUpdatesTest.cpp
> index 27948c1ad6f1a..08d41e46d4a83 100644
> --- a/llvm/unittests/IR/DominatorTreeBatchUpdatesTest.cpp
> +++ b/llvm/unittests/IR/DominatorTreeBatchUpdatesTest.cpp
> @@ -23,7 +23,7 @@ const auto CFGDelete = CFGBuilder::ActionKind::Delete;
>
> using DomUpdate = DominatorTree::UpdateType;
> static_assert(
> - std::is_same_v<DomUpdate, PostDominatorTree::UpdateType>,
> + std::is_same<DomUpdate, PostDominatorTree::UpdateType>::value,
> "Trees
> diff ering only in IsPostDom should have the same update types");
> using DomSNCA = DomTreeBuilder::SemiNCAInfo<DomTreeBuilder::BBDomTree>;
> using PostDomSNCA = DomTreeBuilder::SemiNCAInfo<DomTreeBuilder::BBPostDomTree>;
>
> diff --git a/llvm/unittests/IR/PassBuilderCallbacksTest.cpp b/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
> index 91fa4e88ad784..7785c97564537 100644
> --- a/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
> +++ b/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
> @@ -401,8 +401,8 @@ struct MockPassInstrumentationCallbacks {
>
> template <typename IRUnitT>
> using ExtraMockPassHandle =
> - std::conditional_t<std::is_same_v<IRUnitT, Loop>, MockPassHandle<LoopNest>,
> - MockPassHandle<IRUnitT>>;
> + std::conditional_t<std::is_same<IRUnitT, Loop>::value,
> + MockPassHandle<LoopNest>, MockPassHandle<IRUnitT>>;
>
> template <typename PassManagerT> class PassBuilderCallbacksTest;
>
>
> diff --git a/llvm/unittests/IR/ValueMapTest.cpp b/llvm/unittests/IR/ValueMapTest.cpp
> index ae2912c8f4322..06d5378855351 100644
> --- a/llvm/unittests/IR/ValueMapTest.cpp
> +++ b/llvm/unittests/IR/ValueMapTest.cpp
> @@ -115,7 +115,8 @@ TYPED_TEST(ValueMapTest, OperationsWork) {
>
> template<typename ExpectedType, typename VarType>
> void CompileAssertHasType(VarType) {
> - static_assert(std::is_same_v<ExpectedType, VarType>, "Not the same type");
> + static_assert(std::is_same<ExpectedType, VarType>::value,
> + "Not the same type");
> }
>
> TYPED_TEST(ValueMapTest, Iteration) {
>
> diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp
> index 8ccabaeea5de8..bebb36fc61f22 100644
> --- a/llvm/unittests/Support/Casting.cpp
> +++ b/llvm/unittests/Support/Casting.cpp
> @@ -122,15 +122,15 @@ template <> struct CastInfo<T4, T3> {
> using namespace llvm;
>
> // Test the peculiar behavior of Use in simplify_type.
> -static_assert(std::is_same_v<simplify_type<Use>::SimpleType, Value *>,
> +static_assert(std::is_same<simplify_type<Use>::SimpleType, Value *>::value,
> "Use doesn't simplify correctly!");
> -static_assert(std::is_same_v<simplify_type<Use *>::SimpleType, Value *>,
> +static_assert(std::is_same<simplify_type<Use *>::SimpleType, Value *>::value,
> "Use doesn't simplify correctly!");
>
> // Test that a regular class behaves as expected.
> -static_assert(std::is_same_v<simplify_type<foo>::SimpleType, int>,
> +static_assert(std::is_same<simplify_type<foo>::SimpleType, int>::value,
> "Unexpected simplify_type result!");
> -static_assert(std::is_same_v<simplify_type<foo *>::SimpleType, foo *>,
> +static_assert(std::is_same<simplify_type<foo *>::SimpleType, foo *>::value,
> "Unexpected simplify_type result!");
>
> namespace {
> @@ -177,7 +177,7 @@ TEST(CastingTest, cast) {
>
> std::unique_ptr<const bar> BP(B2);
> auto FP = cast<foo>(std::move(BP));
> - static_assert(std::is_same_v<std::unique_ptr<const foo>, decltype(FP)>,
> + static_assert(std::is_same<std::unique_ptr<const foo>, decltype(FP)>::value,
> "Incorrect deduced return type!");
> EXPECT_NE(FP.get(), null_foo);
> FP.release();
>
> diff --git a/llvm/unittests/Support/ErrorOrTest.cpp b/llvm/unittests/Support/ErrorOrTest.cpp
> index cb0e63660452b..6e5bd2edd3129 100644
> --- a/llvm/unittests/Support/ErrorOrTest.cpp
> +++ b/llvm/unittests/Support/ErrorOrTest.cpp
> @@ -113,26 +113,27 @@ TEST(ErrorOr, ImplicitConversionNoAmbiguity) {
> // ErrorOr<int*> x(nullptr);
> // ErrorOr<std::unique_ptr<int>> y = x; // invalid conversion
> static_assert(
> - !std::is_convertible_v<const ErrorOr<int *> &,
> - ErrorOr<std::unique_ptr<int>>>,
> + !std::is_convertible<const ErrorOr<int *> &,
> + ErrorOr<std::unique_ptr<int>>>::value,
> "do not invoke explicit ctors in implicit conversion from lvalue");
>
> // ErrorOr<std::unique_ptr<int>> y = ErrorOr<int*>(nullptr); // invalid
> // // conversion
> static_assert(
> - !std::is_convertible_v<ErrorOr<int *> &&, ErrorOr<std::unique_ptr<int>>>,
> + !std::is_convertible<ErrorOr<int *> &&,
> + ErrorOr<std::unique_ptr<int>>>::value,
> "do not invoke explicit ctors in implicit conversion from rvalue");
>
> // ErrorOr<int*> x(nullptr);
> // ErrorOr<std::unique_ptr<int>> y;
> // y = x; // invalid conversion
> -static_assert(!std::is_assignable_v<ErrorOr<std::unique_ptr<int>> &,
> - const ErrorOr<int *> &>,
> +static_assert(!std::is_assignable<ErrorOr<std::unique_ptr<int>>&,
> + const ErrorOr<int *> &>::value,
> "do not invoke explicit ctors in assignment");
>
> // ErrorOr<std::unique_ptr<int>> x;
> // x = ErrorOr<int*>(nullptr); // invalid conversion
> -static_assert(
> - !std::is_assignable_v<ErrorOr<std::unique_ptr<int>> &, ErrorOr<int *> &&>,
> - "do not invoke explicit ctors in assignment");
> +static_assert(!std::is_assignable<ErrorOr<std::unique_ptr<int>>&,
> + ErrorOr<int *> &&>::value,
> + "do not invoke explicit ctors in assignment");
> } // end anon namespace
>
> diff --git a/llvm/unittests/Support/ScaledNumberTest.cpp b/llvm/unittests/Support/ScaledNumberTest.cpp
> index 817e8b076686a..82ecce09444d9 100644
> --- a/llvm/unittests/Support/ScaledNumberTest.cpp
> +++ b/llvm/unittests/Support/ScaledNumberTest.cpp
> @@ -562,7 +562,7 @@ TEST(ScaledNumberHelpersTest, toIntBug) {
> EXPECT_EQ(1u, (n * n).toInt<uint32_t>());
> }
>
> -static_assert(std::is_trivially_copyable_v<ScaledNumber<uint32_t>>,
> +static_assert(std::is_trivially_copyable<ScaledNumber<uint32_t>>::value,
> "trivially copyable");
>
> } // end namespace
>
> diff --git a/llvm/unittests/Support/ThreadLocalTest.cpp b/llvm/unittests/Support/ThreadLocalTest.cpp
> index 454e4f21a05fe..075d7d95b25b0 100644
> --- a/llvm/unittests/Support/ThreadLocalTest.cpp
> +++ b/llvm/unittests/Support/ThreadLocalTest.cpp
> @@ -25,8 +25,9 @@ struct S {
> TEST_F(ThreadLocalTest, Basics) {
> ThreadLocal<const S> x;
>
> - static_assert(std::is_const_v<std::remove_pointer_t<decltype(x.get())>>,
> - "ThreadLocal::get didn't return a pointer to const object");
> + static_assert(
> + std::is_const<std::remove_pointer<decltype(x.get())>::type>::value,
> + "ThreadLocal::get didn't return a pointer to const object");
>
> EXPECT_EQ(nullptr, x.get());
>
> @@ -39,8 +40,9 @@ TEST_F(ThreadLocalTest, Basics) {
>
> ThreadLocal<S> y;
>
> - static_assert(!std::is_const_v<std::remove_pointer_t<decltype(y.get())>>,
> - "ThreadLocal::get returned a pointer to const object");
> + static_assert(
> + !std::is_const<std::remove_pointer<decltype(y.get())>::type>::value,
> + "ThreadLocal::get returned a pointer to const object");
>
> EXPECT_EQ(nullptr, y.get());
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list