[clang] [clang][Interp] Three-way comparisons (PR #65901)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 06:31:53 PDT 2023
================
@@ -253,6 +253,29 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
return this->delegate(RHS);
}
+ // Special case for C++'s three-way/spaceship operator <=>, which
+ // returns a std::strong_ordering (which is class, so doesn't have a
----------------
erichkeane wrote:
So this isn't really true, see the rules here: https://en.cppreference.com/w/cpp/language/default_comparisons
It can end up returning a `std::weak_ordering` or `std::partial_ordering` as well. The rest here is true, but I wanted to make sure you know, since these have slightly different semantics that I don't see handled here?
https://github.com/llvm/llvm-project/pull/65901
More information about the cfe-commits
mailing list