diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -1507,6 +1507,9 @@ functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivially relocatable via the ``clang::trivial_abi`` attribute. +* ``__is_trivially_equality_comparable`` (Clang): Returns true if comparing two + objects of the provided type is known to be equivalent to comparing their + value representations. * ``__is_unbounded_array`` (C++, GNU, Microsoft, Embarcadero) * ``__is_union`` (C++, GNU, Microsoft, Embarcadero) * ``__is_unsigned`` (C++, Embarcadero): @@ -4928,7 +4931,7 @@ `dump` ------ Accepts either a single identifier or an expression. When a single identifier is passed, -the lookup results for the identifier are printed to `stderr`. When an expression is passed, +the lookup results for the identifier are printed to `stderr`. When an expression is passed, the AST for the expression is printed to `stderr`. The expression is an unevaluated operand, so things like overload resolution and template instantiations are performed, but the expression has no runtime effects. diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -1446,7 +1446,7 @@ } /// Notify the class that this destructor is now selected. - /// + /// /// Important properties of the class depend on destructor properties. Since /// C++20, it is possible to have multiple destructor declarations in a class /// out of which one will be selected at the end. diff --git a/clang/include/clang/AST/RecordLayout.h b/clang/include/clang/AST/RecordLayout.h --- a/clang/include/clang/AST/RecordLayout.h +++ b/clang/include/clang/AST/RecordLayout.h @@ -128,6 +128,13 @@ /// has this property. Only used for MS-ABI. bool LeadsWithZeroSizedBase : 1; + /// True if there could be padding between members of the record. + /// Tail-padding is ignored. + bool MightHaveInternalPadding : 1; + + /// True if there could be tail padding. + bool MightHaveTailPadding : 1; + /// PrimaryBase - The primary base info for this record. llvm::PointerIntPair PrimaryBase; @@ -167,6 +174,7 @@ const CXXRecordDecl *PrimaryBase, bool IsPrimaryBaseVirtual, const CXXRecordDecl *BaseSharingVBPtr, bool EndsWithZeroSizedObject, bool LeadsWithZeroSizedBase, + bool MightHaveInternalPadding, bool MightHaveTailPadding, const BaseOffsetsMapTy &BaseOffsets, const VBaseOffsetsMapTy &VBaseOffsets); @@ -319,6 +327,16 @@ return CXXInfo->LeadsWithZeroSizedBase; } + bool mightHaveInternalPadding() const { + assert(CXXInfo && "Record layout does not have C++ specific info!"); + return CXXInfo->MightHaveInternalPadding; + } + + bool mightHaveTailPadding() const { + assert(CXXInfo && "Record layout does not have C++ specific info!"); + return CXXInfo->MightHaveTailPadding; + } + /// getVBPtrOffset - Get the offset for virtual base table pointer. /// This is only meaningful with the Microsoft ABI. CharUnits getVBPtrOffset() const { diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -899,6 +899,9 @@ /// Return true if this is a trivially relocatable type. bool isTriviallyRelocatableType(const ASTContext &Context) const; + /// Return true if this is a trivially equality comparable type. + bool isTriviallyEqualityComparableType(const ASTContext &Context) const; + /// Returns true if it is a class and it might be dynamic. bool mayBeDynamicClass() const; diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def --- a/clang/include/clang/Basic/TokenKinds.def +++ b/clang/include/clang/Basic/TokenKinds.def @@ -519,6 +519,7 @@ // Clang-only C++ Type Traits TYPE_TRAIT_1(__is_trivially_relocatable, IsTriviallyRelocatable, KEYCXX) +TYPE_TRAIT_1(__is_trivially_equality_comparable, IsTriviallyEqualityComparable, KEYCXX) TYPE_TRAIT_1(__is_bounded_array, IsBoundedArray, KEYCXX) TYPE_TRAIT_1(__is_unbounded_array, IsUnboundedArray, KEYCXX) TYPE_TRAIT_1(__is_nullptr, IsNullPointer, KEYCXX) diff --git a/clang/lib/AST/RecordLayout.cpp b/clang/lib/AST/RecordLayout.cpp --- a/clang/lib/AST/RecordLayout.cpp +++ b/clang/lib/AST/RecordLayout.cpp @@ -51,13 +51,14 @@ CharUnits preferrednvalignment, CharUnits SizeOfLargestEmptySubobject, const CXXRecordDecl *PrimaryBase, bool IsPrimaryBaseVirtual, const CXXRecordDecl *BaseSharingVBPtr, bool EndsWithZeroSizedObject, - bool LeadsWithZeroSizedBase, const BaseOffsetsMapTy &BaseOffsets, + bool LeadsWithZeroSizedBase, bool MightHaveInternalPadding, + bool MightHaveTailPadding, const BaseOffsetsMapTy &BaseOffsets, const VBaseOffsetsMapTy &VBaseOffsets) : Size(size), DataSize(datasize), Alignment(alignment), PreferredAlignment(preferredAlignment), UnadjustedAlignment(unadjustedAlignment), RequiredAlignment(requiredAlignment), - CXXInfo(new (Ctx) CXXRecordLayoutInfo) { + CXXInfo(new(Ctx) CXXRecordLayoutInfo) { FieldOffsets.append(Ctx, fieldoffsets.begin(), fieldoffsets.end()); CXXInfo->PrimaryBase.setPointer(PrimaryBase); @@ -74,6 +75,8 @@ CXXInfo->BaseSharingVBPtr = BaseSharingVBPtr; CXXInfo->EndsWithZeroSizedObject = EndsWithZeroSizedObject; CXXInfo->LeadsWithZeroSizedBase = LeadsWithZeroSizedBase; + CXXInfo->MightHaveInternalPadding = MightHaveInternalPadding; + CXXInfo->MightHaveTailPadding = MightHaveTailPadding; #ifndef NDEBUG if (const CXXRecordDecl *PrimaryBase = getPrimaryBase()) { diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -619,6 +619,9 @@ unsigned IsMsStruct : 1; + unsigned HasInternalPadding : 1; + unsigned HasTailPadding : 1; + /// UnfilledBitsInLastUnit - If the last field laid out was a bitfield, /// this contains the number of bits in the last unit that can be used for /// an adjacent bitfield if necessary. The unit in question is usually @@ -697,9 +700,10 @@ InferAlignment(false), Packed(false), IsUnion(false), IsMac68kAlign(false), IsNaturalAlign(!Context.getTargetInfo().getTriple().isOSAIX()), - IsMsStruct(false), UnfilledBitsInLastUnit(0), - LastBitfieldStorageUnitSize(0), MaxFieldAlignment(CharUnits::Zero()), - DataSize(0), NonVirtualSize(CharUnits::Zero()), + IsMsStruct(false), HasInternalPadding(false), HasTailPadding(false), + UnfilledBitsInLastUnit(0), LastBitfieldStorageUnitSize(0), + MaxFieldAlignment(CharUnits::Zero()), DataSize(0), + NonVirtualSize(CharUnits::Zero()), NonVirtualAlignment(CharUnits::One()), PreferredNVAlignment(CharUnits::One()), PaddedFieldSize(CharUnits::Zero()), PrimaryBase(nullptr), @@ -2186,6 +2190,7 @@ if (const RecordDecl *RD = dyn_cast(D)) { // Warn if padding was introduced to the struct/class/union. if (getSizeInBits() > UnpaddedSize) { + HasTailPadding = true; unsigned PadSize = getSizeInBits() - UnpaddedSize; bool InBits = true; if (PadSize % CharBitNum == 0) { @@ -2283,6 +2288,7 @@ // Warn if padding was introduced to the struct/class. if (!IsUnion && Offset > UnpaddedOffset) { + HasInternalPadding = true; unsigned PadSize = Offset - UnpaddedOffset; bool InBits = true; if (PadSize % CharBitNum == 0) { @@ -3307,8 +3313,8 @@ Builder.DataSize, Builder.FieldOffsets, Builder.NonVirtualSize, Builder.Alignment, Builder.Alignment, CharUnits::Zero(), Builder.PrimaryBase, false, Builder.SharedVBPtrBase, - Builder.EndsWithZeroSizedObject, Builder.LeadsWithZeroSizedBase, - Builder.Bases, Builder.VBases); + Builder.EndsWithZeroSizedObject, Builder.LeadsWithZeroSizedBase, true, + true, Builder.Bases, Builder.VBases); } else { Builder.layout(D); NewEntry = new (*this) ASTRecordLayout( @@ -3342,7 +3348,8 @@ NonVirtualSize, Builder.NonVirtualAlignment, Builder.PreferredNVAlignment, EmptySubobjects.SizeOfLargestEmptySubobject, Builder.PrimaryBase, - Builder.PrimaryBaseIsVirtual, nullptr, false, false, Builder.Bases, + Builder.PrimaryBaseIsVirtual, nullptr, false, false, + Builder.HasInternalPadding, Builder.HasTailPadding, Builder.Bases, Builder.VBases); } else { ItaniumRecordLayoutBuilder Builder(*this, /*EmptySubobjects=*/nullptr); diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -25,6 +25,7 @@ #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/NonTrivialTypeVisitor.h" #include "clang/AST/PrettyPrinter.h" +#include "clang/AST/RecordLayout.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/TemplateName.h" #include "clang/AST/TypeVisitor.h" @@ -2594,6 +2595,51 @@ } } +bool QualType::isTriviallyEqualityComparableType( + const ASTContext &Context) const { + QualType CanonicalType = getCanonicalType(); + if (CanonicalType->isIncompleteType()) + return false; + + if (CanonicalType->isSizelessBuiltinType()) + return true; + + if (CanonicalType->isIntegerType()) + return true; + + if (const auto *RecordDecl = CanonicalType->getAsCXXRecordDecl()) { + if (!RecordDecl->isStandardLayout() || RecordDecl->isUnion()) + return false; + + if (llvm::none_of(RecordDecl->methods(), + [](const CXXMethodDecl *MemberFunction) { + return MemberFunction->isOverloadedOperator() && + MemberFunction->getOverloadedOperator() == + OverloadedOperatorKind::OO_EqualEqual && + MemberFunction->isDefaulted(); + })) + return false; + + if (!llvm::all_of(RecordDecl->bases(), [&](const CXXBaseSpecifier &base) { + return base.getType().isTriviallyEqualityComparableType(Context); + })) + return false; + + if (!llvm::all_of(RecordDecl->fields(), [&](const FieldDecl *field) { + return field->getType().isTriviallyEqualityComparableType(Context); + })) + return false; + + const ASTRecordLayout &RecordLayout = + Context.getASTRecordLayout(RecordDecl); + + return !RecordLayout.mightHaveInternalPadding() && + !RecordLayout.mightHaveTailPadding(); + } + + return false; +} + bool QualType::isNonWeakInMRRWithObjCWeak(const ASTContext &Context) const { return !Context.getLangOpts().ObjCAutoRefCount && Context.getLangOpts().ObjCWeak && diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -4886,8 +4886,10 @@ case UTT_IsStandardLayout: case UTT_IsPOD: case UTT_IsLiteral: - // By analogy, is_trivially_relocatable imposes the same constraints. + // By analogy, is_trivially_relocatable and is_Trivially_equality_comparable + // impose the same constraints. case UTT_IsTriviallyRelocatable: + case UTT_IsTriviallyEqualityComparable: case UTT_CanPassInRegs: // Per the GCC type traits documentation, T shall be a complete type, cv void, // or an array of unknown bound. But GCC actually imposes the same constraints @@ -5382,6 +5384,8 @@ return RD->canPassInRegisters(); Self.Diag(KeyLoc, diag::err_builtin_pass_in_regs_non_class) << T; return false; + case UTT_IsTriviallyEqualityComparable: + return T.isTriviallyEqualityComparableType(C); } } diff --git a/clang/test/SemaCXX/type-traits.cpp b/clang/test/SemaCXX/type-traits.cpp --- a/clang/test/SemaCXX/type-traits.cpp +++ b/clang/test/SemaCXX/type-traits.cpp @@ -1,6 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++11 -fblocks -Wno-deprecated-builtins %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++14 -fblocks -Wno-deprecated-builtins %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++1z -fblocks -Wno-deprecated-builtins %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++11 -fblocks -Wno-deprecated-builtins -Wno-defaulted-function-deleted %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++14 -fblocks -Wno-deprecated-builtins -Wno-defaulted-function-deleted %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++17 -fblocks -Wno-deprecated-builtins -Wno-defaulted-function-deleted %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++20 -fblocks -Wno-deprecated-builtins -Wno-defaulted-function-deleted %s #define T(b) (b) ? 1 : -1 #define F(b) (b) ? -1 : 1 @@ -570,7 +571,11 @@ static_assert(__is_aggregate(DerivesAr), ""); static_assert(__is_aggregate(DerivesArNB), ""); static_assert(!__is_aggregate(HasCons), ""); +#if __cplusplus >= 202002L + static_assert(!__is_aggregate(HasDefaultCons), ""); +#else static_assert(__is_aggregate(HasDefaultCons), ""); +#endif static_assert(!__is_aggregate(HasExplicitDefaultCons), ""); static_assert(!__is_aggregate(HasInheritedCons), ""); static_assert(__is_aggregate(HasNoInheritedCons) == TrueAfterCpp14, ""); @@ -3055,6 +3060,149 @@ } // namespace is_trivially_relocatable +namespace is_trivially_equality_comparable { +struct ForwardDeclared; // expected-note {{forward declaration of 'is_trivially_equality_comparable::ForwardDeclared'}} +static_assert(!__is_trivially_equality_comparable(ForwardDeclared), ""); // expected-error {{incomplete type 'ForwardDeclared' used in type trait expression}} + +static_assert(!__is_trivially_equality_comparable(void), ""); +static_assert(__is_trivially_equality_comparable(int), ""); +static_assert(!__is_trivially_equality_comparable(int[]), ""); +static_assert(!__is_trivially_equality_comparable(int[3]), ""); +static_assert(!__is_trivially_equality_comparable(float), ""); +static_assert(!__is_trivially_equality_comparable(double), ""); +static_assert(!__is_trivially_equality_comparable(long double), ""); + +struct TriviallyEqualityComparableNoDefaultedComparator { + int i; + int j; +}; +static_assert(!__is_trivially_equality_comparable(TriviallyEqualityComparableNoDefaultedComparator), ""); + +#if __cplusplus >= 202002L + +struct TriviallyEqualityComparable { + int i; + int j; + + void func(); + bool operator==(int) const { return false; } + + bool operator==(const TriviallyEqualityComparable&) const = default; +}; +static_assert(__is_trivially_equality_comparable(TriviallyEqualityComparable), ""); + +struct NotTriviallyEqualityComparableHasPadding { + short i; + int j; + + bool operator==(const NotTriviallyEqualityComparableHasPadding&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableHasPadding), ""); + +struct NotTriviallyEqualityComparableHasFloat { + float i; + int j; + + bool operator==(const NotTriviallyEqualityComparableHasFloat&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableHasFloat), ""); + +struct NotTriviallyEqualityComparableHasTailPadding { + int i; + char j; + + bool operator==(const NotTriviallyEqualityComparableHasTailPadding&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableHasTailPadding), ""); + +struct NotTriviallyEqualityComparableBase : NotTriviallyEqualityComparableHasTailPadding { + char j; + + bool operator==(const NotTriviallyEqualityComparableBase&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableBase), ""); + +// TODO: This is trivially equality comparable +class TriviallyEqualityComparablePaddedOutBase { + int i; + char c; + +public: + bool operator==(const TriviallyEqualityComparablePaddedOutBase&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(TriviallyEqualityComparablePaddedOutBase), ""); + +struct TriviallyEqualityComparablePaddedOut : TriviallyEqualityComparablePaddedOutBase { + char j[3]; + + bool operator==(const TriviallyEqualityComparablePaddedOut&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(TriviallyEqualityComparablePaddedOut), ""); + +struct TriviallyEqualityComparable1 { + char i; + + bool operator==(const TriviallyEqualityComparable1&) const = default; +}; +static_assert(__is_trivially_equality_comparable(TriviallyEqualityComparable1)); + +struct TriviallyEqualityComparable2 { + int i; + + bool operator==(const TriviallyEqualityComparable2&) const = default; +}; +static_assert(__is_trivially_equality_comparable(TriviallyEqualityComparable2)); + +struct NotTriviallyEqualityComparableTriviallyEqualityComparableBases + : TriviallyEqualityComparable1, TriviallyEqualityComparable2 { + bool operator==(const NotTriviallyEqualityComparableTriviallyEqualityComparableBases&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableTriviallyEqualityComparableBases)); + +struct NotTriviallyEqualityComparableBitfield { + int i : 1; + + bool operator==(const NotTriviallyEqualityComparableBitfield&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableBitfield)); + +// TODO: This is trivially equality comparable +struct NotTriviallyEqualityComparableBitfieldFilled { + char i : __CHAR_BIT__; + + bool operator==(const NotTriviallyEqualityComparableBitfieldFilled&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableBitfield)); + +union U { + int i; + + bool operator==(const U&) const = default; +}; + +struct NotTriviallyEqualityComparableImplicitlyDeletedOperatorByUnion { + U u; + + bool operator==(const NotTriviallyEqualityComparableImplicitlyDeletedOperatorByUnion&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableImplicitlyDeletedOperatorByUnion)); + +struct NotTriviallyEqualityComparableExplicitlyDeleted { + int i; + + bool operator==(const NotTriviallyEqualityComparableExplicitlyDeleted&) const = delete; +}; + +struct NotTriviallyEqualityComparableImplicitlyDeletedOperatorByStruct { + NotTriviallyEqualityComparableExplicitlyDeleted u; + + bool operator==(const NotTriviallyEqualityComparableImplicitlyDeletedOperatorByStruct&) const = default; +}; +static_assert(!__is_trivially_equality_comparable(NotTriviallyEqualityComparableImplicitlyDeletedOperatorByStruct)); + +#endif // __cplusplus >= 202002L +}; + namespace can_pass_in_regs { struct A { }; diff --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h --- a/libcxx/include/__algorithm/equal.h +++ b/libcxx/include/__algorithm/equal.h @@ -46,7 +46,7 @@ class _Up, class _BinaryPredicate, __enable_if_t<__is_trivial_equality_predicate<_BinaryPredicate, _Tp, _Up>::value && !is_volatile<_Tp>::value && - !is_volatile<_Up>::value && __is_trivially_equality_comparable<_Tp, _Up>::value, + !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value, int> = 0> _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) { @@ -96,7 +96,7 @@ class _Proj2, __enable_if_t<__is_trivial_equality_predicate<_Pred, _Tp, _Up>::value && __is_identity<_Proj1>::value && __is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value && - __is_trivially_equality_comparable<_Tp, _Up>::value, + __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value, int> = 0> _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __equal_impl( _Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) { diff --git a/libcxx/include/__string/constexpr_c_functions.h b/libcxx/include/__string/constexpr_c_functions.h --- a/libcxx/include/__string/constexpr_c_functions.h +++ b/libcxx/include/__string/constexpr_c_functions.h @@ -39,7 +39,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, size_t __count) { static_assert( - __is_trivially_equality_comparable<_Tp, _Up>::value, "_Tp and _Up have to be trivially equality comparable"); + __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value, "_Tp and _Up have to be trivially equality comparable"); if (__libcpp_is_constant_evaluated()) { #ifdef _LIBCPP_COMPILER_CLANG_BASED diff --git a/libcxx/include/__type_traits/is_equality_comparable.h b/libcxx/include/__type_traits/is_equality_comparable.h --- a/libcxx/include/__type_traits/is_equality_comparable.h +++ b/libcxx/include/__type_traits/is_equality_comparable.h @@ -43,14 +43,14 @@ // always compared. template -struct __is_trivially_equality_comparable +struct __libcpp_is_trivially_equality_comparable : integral_constant::value && is_integral<_Tp>::value && is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value> {}; // TODO: Use is_pointer_inverconvertible_base_of template -struct __is_trivially_equality_comparable<_Tp*, _Up*> +struct __libcpp_is_trivially_equality_comparable<_Tp*, _Up*> : integral_constant< bool, __is_equality_comparable<_Tp*, _Up*>::value && diff --git a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp --- a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp +++ b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp @@ -13,32 +13,32 @@ enum Enum : int {}; enum class EnumClass : int {}; -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); struct S { char c; @@ -51,8 +51,8 @@ struct VirtualBase : virtual S {}; struct NonVirtualBase : S, S2 {}; -static_assert(!std::__is_trivially_equality_comparable::value, ""); -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, ""); // This is trivially_equality_comparable, but we can't detect it currently -static_assert(!std::__is_trivially_equality_comparable::value, ""); +static_assert(!std::__libcpp_is_trivially_equality_comparable::value, "");