Currently, an APSInt test fails to compile in C++20 mode due to ambiguity in
the available set of operator== thanks to synthetic three-way rewrite rules.
Specifically, the error is:
error: use of overloaded operator '==' is ambiguous (with operand types 'const llvm::APSInt' and 'const unsigned long long') from llvm/unittests/ADT/APFixedPointTest.cpp:698:3: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<llvm::APSInt, unsigned long long, nullptr>' requested here ASSERT_EQ(Val.convert(getLFractSema()).getValue(), -(1ULL << 31)); ^
The candidates are:
llvm/include/llvm/ADT/APInt.h:2032:13: note: candidate function (with reversed parameter order) inline bool operator==(uint64_t V1, const APInt &V2) { return V2 == V1; } ^ llvm/include/llvm/ADT/APSInt.h:174:8: note: candidate function bool operator==(int64_t RHS) const { ^ llvm/include/llvm/ADT/APSInt.h:343:13: note: candidate function (with reversed parameter order) inline bool operator==(int64_t V1, const APSInt &V2) { return V2 == V1; }
Make this case unambiguous by gating the extra operator== and operator!= on
the existence of three way comparison feature test macro.