diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-03-09 08:42:19 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-03-09 08:42:19 -0500 |
commit | fe548eb8436f3906e6a3c6e3e8707d24e60ec0fa (patch) | |
tree | d155334d863e95a715b555679753ac37c91d8f04 /gcc/cfgexpand.cc | |
parent | 4470e813b0b46d2e579b9e3d69a41a7192709c50 (diff) | |
download | gcc-fe548eb8436f3906e6a3c6e3e8707d24e60ec0fa.zip gcc-fe548eb8436f3906e6a3c6e3e8707d24e60ec0fa.tar.gz gcc-fe548eb8436f3906e6a3c6e3e8707d24e60ec0fa.tar.bz2 |
c++: merge default targs for function templates [PR65396]
We currently merge default template arguments for class templates, but
not for function templates. This patch fixes this by factoring out the
argument merging logic in redeclare_class_template into a separate
function and using it in duplicate_decls as well.
PR c++/65396
gcc/cp/ChangeLog:
* cp-tree.h (merge_default_template_args): Declare.
* decl.cc (merge_default_template_args): Define, factored out
from redeclare_class_template.
(duplicate_decls): Use it when merging member function template
and free function declarations.
* pt.cc (redeclare_class_template): Factor out default argument
merging logic into merge_default_template_args. Improve location
of a note when there's a template parameter kind mismatch.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/vt-34314.C: Adjust expected location of
"redeclared here" note.
* g++.dg/template/pr92440.C: Likewise.
* g++.old-deja/g++.pt/redecl1.C: Adjust expected location of
"redefinition of default argument" error.
* g++.dg/template/defarg23.C: New test.
* g++.dg/template/defarg23a.C: New test.
Diffstat (limited to 'gcc/cfgexpand.cc')
0 files changed, 0 insertions, 0 deletions