[Bug c++/79501] member deduction guide not recognized

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 12 20:35:40 GMT 2021


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

--- Comment #4 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:8d75b8830e9dafb4e0c400c723653512adf40295

commit r12-2260-g8d75b8830e9dafb4e0c400c723653512adf40295
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Jul 12 16:35:18 2021 -0400

    c++: permit deduction guides at class scope [PR79501]

    This adds support for declaring (class-scope) deduction guides for a
    member class template.  Fortunately it seems only a couple of changes
    are needed in order for the existing CTAD machinery to handle them
    properly: we need to make sure to give them a FUNCTION_TYPE instead of a
    METHOD_TYPE, and we need to avoid using a BASELINK when looking them up.

            PR c++/79501
            PR c++/100983

    gcc/cp/ChangeLog:

            * decl.c (grokfndecl): Don't require that deduction guides are
            declared at namespace scope.  Check that class-scope deduction
            guides have the same access as the member class template.
            (grokdeclarator): Pretend class-scope deduction guides are static.
            * search.c (lookup_member): Don't use a BASELINK for (class-scope)
            deduction guides.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/class-deduction92.C: New test.
            * g++.dg/cpp1z/class-deduction93.C: New test.
            * g++.dg/cpp1z/class-deduction94.C: New test.
            * g++.dg/cpp1z/class-deduction95.C: New test.


More information about the Gcc-bugs mailing list