aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-12-13 16:45:50 -0500
committerPatrick Palka <ppalka@redhat.com>2023-12-13 16:45:50 -0500
commitead2b94d602ce758575aa46ec35a51c3157ff9cd (patch)
tree1e47c1d1d1d6749824ce83e9692ea80f9654c941 /libcpp
parent35ba3add7d0a9fc6ce955ba8ad82b0413e86ad7d (diff)
downloadgcc-ead2b94d602ce758575aa46ec35a51c3157ff9cd.zip
gcc-ead2b94d602ce758575aa46ec35a51c3157ff9cd.tar.gz
gcc-ead2b94d602ce758575aa46ec35a51c3157ff9cd.tar.bz2
c++: sort candidates according to viability
This patch: * changes splice_viable to move the non-viable candidates to the end of the list instead of removing them outright * makes tourney move the best candidate to the front of the candidate list * adjusts print_z_candidates to preserve our behavior of printing only viable candidates when diagnosing ambiguity * adds a parameter to print_z_candidates to control this default behavior (the follow-up patch will want to print all candidates when diagnosing deletedness) Thus after this patch we have access to the entire candidate list through the best viable candidate. This change also happens to fix diagnostics for the below testcase where we currently neglect to note the third candidate, since the presence of the two unordered non-strictly viable candidates causes splice_viable to prematurely get rid of the non-viable third candidate. gcc/cp/ChangeLog: * call.cc: Include "tristate.h". (splice_viable): Sort the candidate list according to viability. Don't remove non-viable candidates from the list. (print_z_candidates): Add defaulted only_viable_p parameter. By default only print non-viable candidates if there is no viable candidate. (tourney): Ignore non-viable candidates. Move the true champ to the front of the candidates list, and update 'candidates' to point to the front. Rename champ_compared_to_predecessor to previous_worse_champ. gcc/testsuite/ChangeLog: * g++.dg/overload/error5.C: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions