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

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

https://gcc.gnu.org/g:5a2c4c1e171d2681a506f6de2235a32293e69b3f

commit r11-9389-g5a2c4c1e171d2681a506f6de2235a32293e69b3f
Author: Patrick Palka <ppa...@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.

    (cherry picked from commit 90de06a7b3ce6ae8381136e58a2dde91fbbb6eff)
  • [Bug c++/99911] C++20 adl issue cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to