4ed1dc1275
I thought I had implemented P1186R3, but apparently I didn't read it closely enough to understand the point of the paper, namely that for a defaulted operator<=>, if a member type doesn't have a viable operator<=>, we will use its operator< and operator== if the defaulted operator has an specific comparison category as its return type; the compiler can't guess if it should be strong_ordering or something else, but the user can make that choice explicit. The libstdc++ test change was necessary because of the change in genericize_spaceship from op0 > op1 to op1 < op0; this should be equivalent, but isn't because of PR88173. gcc/cp/ChangeLog: PR c++/96299 * cp-tree.h (build_new_op): Add overload that omits some parms. (genericize_spaceship): Add location_t parm. * constexpr.c (cxx_eval_binary_expression): Pass it. * cp-gimplify.c (genericize_spaceship): Pass it. * method.c (genericize_spaceship): Handle class-type arguments. (build_comparison_op): Fall back to op</== when appropriate. gcc/testsuite/ChangeLog: PR c++/96299 * g++.dg/cpp2a/spaceship-synth-neg2.C: Move error. * g++.dg/cpp2a/spaceship-p1186.C: New test. libstdc++-v3/ChangeLog: PR c++/96299 * testsuite/18_support/comparisons/algorithms/partial_order.cc: One more line needs to use VERIFY instead of static_assert. |
||
---|---|---|
.. | ||
17_intro | ||
18_support | ||
19_diagnostics | ||
20_util | ||
21_strings | ||
22_locale | ||
23_containers | ||
24_iterators | ||
25_algorithms | ||
26_numerics | ||
27_io | ||
28_regex | ||
29_atomics | ||
30_threads | ||
abi | ||
backward | ||
config | ||
data | ||
decimal | ||
experimental | ||
ext | ||
lib | ||
libstdc++-abi | ||
libstdc++-dg | ||
libstdc++-prettyprinters | ||
libstdc++-xmethods | ||
performance | ||
special_functions | ||
std | ||
tr1 | ||
tr2 | ||
util | ||
Makefile.am | ||
Makefile.in |