https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106760

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Patrick Palka
<ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:79c5a09f959dc63824bd005522a072424f16d89d

commit r14-10449-g79c5a09f959dc63824bd005522a072424f16d89d
Author: Patrick Palka <ppa...@redhat.com>
Date:   Fri Jun 28 19:45:21 2024 -0400

    c++: bad 'this' conversion for nullary memfn [PR106760]

    Here we notice the 'this' conversion for the call f<void>() is bad, so
    we correctly defer deduction for the template candidate, but we end up
    never adding it to 'bad_cands' since missing_conversion_p for it returns
    false (its only argument is 'this' which has already been determined to
    be bad).  This is not a huge deal, but it causes us to longer accept the
    call with -fpermissive in release builds, and a tree check ICE in checking
    builds.

    So if we have a non-strictly viable template candidate that has not been
    instantiated, then we need to add it to 'bad_cands' even if no argument
    conversion is missing.

            PR c++/106760

    gcc/cp/ChangeLog:

            * call.cc (add_candidates): Relax test for adding a candidate
            to 'bad_cands' to also accept an uninstantiated template candidate
            that has no missing conversions.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/conv3.C: New test.

    Reviewed-by: Jason Merrill <ja...@redhat.com>
    (cherry picked from commit 50073ffae0a9b8feb9b36fdafdebd9885f6d7dc8)

Reply via email to