https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115163
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <[email protected]>: https://gcc.gnu.org/g:3e8ce187dc4595da3d2f41a0fb09ee9cd2e437ff commit r16-6707-g3e8ce187dc4595da3d2f41a0fb09ee9cd2e437ff Author: Nathaniel Shead <[email protected]> Date: Sun Jan 11 10:02:45 2026 +1100 c++: Improve diagnostic for implicit conversion errors [PR115163] This patch adds a note to indicate if any viable explicit conversion functions were skipped if an implicit conversion failed to occur. Perhaps the base diagnostic in ocp_convert can be further improved for class types as well, as the current message is not very clear, but I've not looked into that for this patch. PR c++/115163 gcc/cp/ChangeLog: * call.cc (implicit_conversion_error): Add flags argument, call maybe_show_nonconverting_candidate. (build_converted_constant_expr_internal): Pass flags to implicit_conversion_error. (perform_implicit_conversion_flags): Likewise. * cvt.cc (ocp_convert): Call maybe_show_nonconverting_candidate on conversion error. gcc/testsuite/ChangeLog: * g++.dg/ext/is_convertible7.C: Add new testcases. * g++.dg/diagnostic/explicit2.C: New test. Signed-off-by: Nathaniel Shead <[email protected]> Reviewed-by: Jason Merrill <[email protected]>
