[PATCH] D147175: [clang] Add __is_trivially_equality_comparable

Nikolas Klauser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 11:26:28 PDT 2023


philnik added a comment.

In D147175#4240572 <https://reviews.llvm.org/D147175#4240572>, @aaron.ballman wrote:

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

These two traits are indeed very similar. The main difference is that `has_unique_object_representations` requires that the type is trivially copyable, and `__is_trivially_equality_comparable` requires a defaulted equality comparison operator.



================
Comment at: clang/lib/AST/Type.cpp:2640
+
+  return false;
+}
----------------
aaron.ballman wrote:
> I think this might be missing cases, like complex integers, scoped enumerations, vector types?, pointer types, atomic versions of these types...
I think this should be covered by the switch to using `hasUniqueObjectRepresentation`.


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