]> git.ipfire.org Git - thirdparty/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 18:11:55 +0000 (14:11 -0400)
commit2843bfa21073dd1ac222540e189e8bcf40afc2c0
tree0d4914cb36bd1dd9ef1878f5907043fa15684870
parent7a4b608b31af3824d615cd490f855e3730d217b4
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.cc (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.cc
gcc/testsuite/g++.dg/cpp1y/auto-fn64.C [new file with mode: 0644]