[PATCH] D151623: [clang] Extend __is_trivially_equality_comparable to check for hidden friends

Nikolas Klauser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 07:47:29 PDT 2023


philnik added a comment.

In D151623#4380760 <https://reviews.llvm.org/D151623#4380760>, @erichkeane wrote:

> Is this a builtin that is supposed to model something in the standard?  It isn't clear to me how this one is supposed to work.

No, this is for optimization purposes. It is true when it is know that comparing two instances of T is equivalent to a `memcmp`. Or in other words every bit in the type is part of its value representation. Does that help?



================
Comment at: clang/test/SemaCXX/type-traits.cpp:3439
+
 #endif // __cplusplus >= 202002L
 };
----------------
erichkeane wrote:
> Is there a reason these tests need to be c++20 only?
Defaulted equality comparison is a C++20 feature.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151623



More information about the cfe-commits mailing list