]> gcc.gnu.org Git - gcc.git/commit
c++: redeclared hidden friend [PR105761]
authorJason Merrill <jason@redhat.com>
Fri, 3 Jun 2022 16:35:12 +0000 (12:35 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 3 Jun 2022 17:45:13 +0000 (13:45 -0400)
commitc27cbeb985f7b6e1759399971b4fe2773e91ca71
treed34a54ae74166366cbda5a80382f80b06a76bc91
parent340c53bc6352d223f543faac71996a3fa87d9119
c++: redeclared hidden friend [PR105761]

Here, when we see the second declaration of f we match it with the first
one, copy over DECL_TEMPLATE_INFO, and then try to use it when parsing the
definition, leading to confusion.

PR c++/105761

gcc/cp/ChangeLog:

* decl.c (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
from a hidden friend.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/auto-fn64.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp1y/auto-fn64.C [new file with mode: 0644]
This page took 0.060518 seconds and 5 git commands to generate.