This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r278465 - in /trunk/gcc: cp/ChangeLog cp/call.c...
- From: jason at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 19 Nov 2019 20:22:12 -0000
- Subject: r278465 - in /trunk/gcc: cp/ChangeLog cp/call.c...
Author: jason
Date: Tue Nov 19 20:22:12 2019
New Revision: 278465
URL: https://gcc.gnu.org/viewcvs?rev=278465&root=gcc&view=rev
Log:
Consider parm types equivalence for operator rewrite tiebreaker.
The C++ committee continues to discuss how best to avoid breaking existing
code with the new rules for reversed operators. A recent suggestion was to
base the tie-breaker on the parameter types of the candidates, which made a
lot of sense to me, so this patch implements that.
This patch also mentions that a candidate was reversed or rewritten when
printing the list of candidates, and warns about a comparison that becomes
recursive under the new rules. There is no flag for this warning; people
can silence it by swapping the operands.
* call.c (same_fn_or_template): Change to cand_parms_match.
(joust): Adjust.
(print_z_candidate): Mark rewritten/reversed candidates.
(build_new_op_1): Warn about recursive call with reversed arguments.
Added:
trunk/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite2.C
trunk/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C
trunk/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c