c++: friend with redundant qualification [PR41723]
authorJason Merrill <jason@redhat.com>
Wed, 7 Apr 2021 20:42:44 +0000 (16:42 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 7 Apr 2021 21:01:52 +0000 (17:01 -0400)
commitfb5ed6d8c90a4bf8e677a3ff9bd79d83636ccff9
tree120e37bf2873827c380a32ca57629c67ce9a73c4
parentb40d45cb1930e9aa8a1f9a6a8728fd47ebeeaaac
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.
gcc/cp/parser.c
gcc/testsuite/g++.dg/template/friend71.C [new file with mode: 0644]