[PATCH] D147175: [clang] Add __is_trivially_equality_comparable

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 07:07:46 PDT 2023


aaron.ballman added a comment.

Hmmm, is this effectively `std::has_unique_object_representations` (ensuring that all bits of the object representation contribute to the value)?



================
Comment at: clang/lib/AST/Type.cpp:2610
+
+  if (const auto *RecordDecl = CanonicalType->getAsCXXRecordDecl()) {
+    if (!RecordDecl->isStandardLayout() || RecordDecl->isUnion())
----------------
Dependent types should probably return `false`?


================
Comment at: clang/lib/AST/Type.cpp:2640
+
+  return false;
+}
----------------
I think this might be missing cases, like complex integers, scoped enumerations, vector types?, pointer types, atomic versions of these types...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147175/new/

https://reviews.llvm.org/D147175



More information about the cfe-commits mailing list