c++: repeated friend template [PR101894]
authorJason Merrill <jason@redhat.com>
Fri, 1 Apr 2022 20:18:31 +0000 (16:18 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 4 Apr 2022 14:44:06 +0000 (10:44 -0400)
commit3afc7c4eeada0a04c2c4ededeb0f6ccc724a58ec
treefdb59a5edb263810f1400386517c37f0166170bf
parenta11f204e5a30d1dfd2508e3f3014509a0342f604
c++: repeated friend template [PR101894]

Since olddecl isn't a definition, it doesn't get DECL_FRIEND_CONTEXT, so we
need to copy it from newdecl when we merge the declarations.

PR c++/101894

gcc/cp/ChangeLog:

* decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.

gcc/testsuite/ChangeLog:

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