__is_trivially_equality_comparable(T)
false positive when the defaulted operator is ineligible
#89293
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Clang's
__is_trivially_equality_comparable(T)
builtin assumes that if a type has any defaulted trivial comparison operator, then all its comparison operators will be tantamount-to-trivial. That's a sane assumption... but only if the defaulted operator is actually eligible for the givenT
! If the defaulted operator isrequires
-clause'd away, then we shouldn't consider it relevant to the question of triviality at all.https://godbolt.org/z/3hs4EKPKT
This compiler misbehavior causes libc++ to miscompile
std::equal
:https://godbolt.org/z/YPfEG6cv9
The text was updated successfully, but these errors were encountered: