c++: operator<=> and -Wzero-as-null-pointer-constant [PR95242]
In C++20, if there is no viable operator< available, lhs < rhs gets
rewritten to (lhs <=> rhs) < 0, where operator< for the comparison
categories is intended to accept literal 0 on the RHS but not other
integers. We don't want this to produce a warning from
-Wzero-as-null-pointer-constant.
gcc/cp/ChangeLog:
* call.c (build_new_op_1): Suppress
warn_zero_as_null_pointer_constant across comparison of <=> result
to 0.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-synth2.C: Add
-Wzero-as-null-pointer-constant.