[Bug c++/99911] C++20 adl issue

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 18 15:05:48 GMT 2021


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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:90de06a7b3ce6ae8381136e58a2dde91fbbb6eff

commit r12-5373-g90de06a7b3ce6ae8381136e58a2dde91fbbb6eff
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Nov 18 10:05:13 2021 -0500

    c++: template-id ADL and partial instantiation [PR99911]

    Here when partially instantiating the call get<U>(T{}) with T=N::A
    (for which earlier unqualified name lookup for 'get' found nothing)
    the arguments after substitution are no longer dependent but the callee
    still is, so perform_koenig_lookup postpones ADL.  But then we go on to
    diagnose the unresolved template name anyway, as if ADL was already
    performed and failed.

    This patch fixes this by avoiding the error path in question when the
    template arguments of an unresolved template-id are still dependent,
    mirroring the dependence check in perform_koenig_lookup.

            PR c++/99911

    gcc/cp/ChangeLog:

            * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Don't diagnose
            name lookup failure if the arguments to an unresolved template
            name are still dependent.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/fn-template24.C: New test.


More information about the Gcc-bugs mailing list