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>
Fri, 17 Mar 2023 18:44:33 +0000 (14:44 -0400)
commitae7190e345a8d80310835cb83b3b41ef2aeb0d37
treef1b345637d8bc1e4657fbc7e9de964d08d6e2cf9
parent24c06560a7fa39049911eeb8777325d112e0deb9
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]