[Bug c++/41723] [9/10 Regression] Error when using a qualified name to declare a nested template instantiation as a friend of the containing template

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 20 21:35:37 GMT 2021


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

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

https://gcc.gnu.org/g:e41d610696b81e72d1d06db176b281424e32fc23

commit r10-9851-ge41d610696b81e72d1d06db176b281424e32fc23
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Apr 7 16:42:44 2021 -0400

    c++: friend with redundant qualification [PR41723]

    Different code paths were correctly choosing to look up D directly, since C
    is the current instantiation, but here we decided to try to make it a
    typename type, leading to confusion.  Fixed by using dependent_scope_p as
we
    do elsewhere.

    gcc/cp/ChangeLog:

            PR c++/41723
            * parser.c (cp_parser_class_name): Check dependent_scope_p.

    gcc/testsuite/ChangeLog:

            PR c++/41723
            * g++.dg/template/friend71.C: New test.


More information about the Gcc-bugs mailing list