aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/config.h.in
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-03-12 15:00:49 -0500
committerPatrick Palka <ppalka@redhat.com>2022-03-12 15:00:49 -0500
commit03c83cf7aa1110e427beb00ea95767dfaf50d694 (patch)
treebda379f6a95aee2a948ea1e4d61f05971829c201 /libgfortran/config.h.in
parent9413bb55185b9e88d84e91d5145d59f9f83b884a (diff)
downloadgcc-03c83cf7aa1110e427beb00ea95767dfaf50d694.zip
gcc-03c83cf7aa1110e427beb00ea95767dfaf50d694.tar.gz
gcc-03c83cf7aa1110e427beb00ea95767dfaf50d694.tar.bz2
c++: ICE with bad conversion shortcutting [PR104622]
When shortcutting bad argument conversions during overload resolution, we assume conversions get computed in sequential order and that therefore the conversion array is incomplete iff the last conversion is missing. But this assumption turns out to be wrong for templates, because during deduction check_non_deducible_conversion can compute an argument conversion out of order. So in the testcase below, at the end of add_template_candidate the conversion array looks like {bad_conv, NULL, good_conv} where the last conversion was computed during deduction and the first one later from add_function_candidate. We need to add this candidate to bad_fns since not all of its argument conversions were computed, but we don't do so because the last conversion isn't missing. This patch fixes this by checking for a missing conversion exhaustively instead. In passing, this cleans up check_non_deducible_conversion given that the only values of 'strict' we expect to see here the enumerators of unification_kind_t. PR c++/104622 gcc/cp/ChangeLog: * call.cc (missing_conversion_p): Define. (add_candidates): Use it. * pt.cc (check_non_deducible_conversion): Change type of strict parameter to unification_kind_t and directly test for DEDUCE_CALL. gcc/testsuite/ChangeLog: * g++.dg/template/conv18.C: New test.
Diffstat (limited to 'libgfortran/config.h.in')
0 files changed, 0 insertions, 0 deletions