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 @@ -2684,7 +2684,7 @@ const ASTContext &Context) const { QualType CanonicalType = getCanonicalType(); if (CanonicalType->isIncompleteType() || CanonicalType->isDependentType() || - CanonicalType->isEnumeralType()) + CanonicalType->isEnumeralType() || CanonicalType->isArrayType()) return false; if (const auto *RD = CanonicalType->getAsCXXRecordDecl()) { 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 @@ -3110,7 +3110,7 @@ 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(int[3]), ""); static_assert(!__is_trivially_equality_comparable(float), ""); static_assert(!__is_trivially_equality_comparable(double), ""); static_assert(!__is_trivially_equality_comparable(long double), ""); @@ -3134,6 +3134,13 @@ }; static_assert(__is_trivially_equality_comparable(TriviallyEqualityComparable), ""); +struct TriviallyEqualityComparableContainsArray { + int a[4]; + + bool operator==(const TriviallyEqualityComparableContainsArray&) const = default; +}; +static_assert(__is_trivially_equality_comparable(TriviallyEqualityComparableContainsArray)); + struct TriviallyEqualityComparableNonTriviallyCopyable { TriviallyEqualityComparableNonTriviallyCopyable(const TriviallyEqualityComparableNonTriviallyCopyable&); ~TriviallyEqualityComparableNonTriviallyCopyable();