[Bug c++/96926] [9/10/11 Regression] Tuple element w/ member reference to incomplete template type rejected

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 19 02:22:26 GMT 2021


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

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

https://gcc.gnu.org/g:187d0d5871b1fa572b0238b4989fa067df56778f

commit r11-7287-g187d0d5871b1fa572b0238b4989fa067df56778f
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Feb 13 00:40:11 2021 -0500

    c++: Tuple of self-dependent classes [PR96926]

    When compiling this testcase, trying to resolve the initialization for the
    tuple member ends up recursively considering the same set of tuple
    constructor overloads, and since two of them separately depend on
    is_constructible, the one we try second fails to instantiate
    is_constructible because we're still in the middle of instantiating it the
    first time.

    Fixed by implementing an optimization that someone suggested we were
already
    doing: if we see a non-template candidate that is a perfect match for all
    arguments, we can skip considering template candidates at all.  It would be
    enough to do this only when LOOKUP_DEFAULTED, but it shouldn't hurt in
other
    cases.

    gcc/cp/ChangeLog:

            PR c++/96926
            * call.c (perfect_conversion_p): New.
            (perfect_candidate_p): New.
            (add_candidates): Ignore templates after a perfect non-template.

    gcc/testsuite/ChangeLog:

            PR c++/96926
            * g++.dg/cpp0x/overload4.C: New test.


More information about the Gcc-bugs mailing list