]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: namespace-scoped friend in local class [PR69410]
authorJason Merrill <jason@redhat.com>
Fri, 17 Mar 2023 13:43:48 +0000 (09:43 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 18 Apr 2023 20:44:27 +0000 (16:44 -0400)
commit615c48b317397c2dc3d6769954d5c399ea882f7a
tree96b2913382da3539b00445e4c6bf02c40239a84d
parentdbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0
c++: namespace-scoped friend in local class [PR69410]

do_friend was only considering class-qualified identifiers for the
qualified-id case, but we also need to skip local scope when there's an
explicit namespace scope.

PR c++/69410

gcc/cp/ChangeLog:

* friend.cc (do_friend): Handle namespace as scope argument.
* decl.cc (grokdeclarator): Pass down in_namespace.

gcc/testsuite/ChangeLog:

* g++.dg/lookup/friend24.C: New test.
gcc/cp/decl.cc
gcc/cp/friend.cc
gcc/testsuite/g++.dg/lookup/friend24.C [new file with mode: 0644]