diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2023-07-10 11:06:54 -0700 |
---|---|---|
committer | Nikolas Klauser <nikolasklauser@berlin.de> | 2023-07-10 11:09:38 -0700 |
commit | c6b4433a0f20c5ebbd72cee8fd0dcfdb429e619c (patch) | |
tree | 998ce50109116f2940fba921695243247cc78bfb /clang/lib/AST/Type.cpp | |
parent | 710874f68c9ec67fb90d226b6e77cdd183ce2ec3 (diff) | |
download | llvm-c6b4433a0f20c5ebbd72cee8fd0dcfdb429e619c.zip llvm-c6b4433a0f20c5ebbd72cee8fd0dcfdb429e619c.tar.gz llvm-c6b4433a0f20c5ebbd72cee8fd0dcfdb429e619c.tar.bz2 |
[clang] Fix __is_trivially_equality_comparable for classes which contain arrays of non-trivially equality comparable types
Fixes #63656
Reviewed By: cor3ntin
Spies: tbaeder, cfe-commits
Differential Revision: https://reviews.llvm.org/D154778
Diffstat (limited to 'clang/lib/AST/Type.cpp')
-rw-r--r-- | clang/lib/AST/Type.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 7ffed14..a1b1757 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -2672,6 +2672,9 @@ HasNonDeletedDefaultedEqualityComparison(const CXXRecordDecl *Decl) { }) && llvm::all_of(Decl->fields(), [](const FieldDecl *FD) { auto Type = FD->getType(); + if (Type->isArrayType()) + Type = Type->getBaseElementTypeUnsafe()->getCanonicalTypeUnqualified(); + if (Type->isReferenceType() || Type->isEnumeralType()) return false; if (const auto *RD = Type->getAsCXXRecordDecl()) |