aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-03-05 15:17:09 +1100
committerNathaniel Shead <nathanieloshead@gmail.com>2024-03-07 21:59:31 +1100
commit77772f8a3da8ea30066d2201f8148714a8e89da5 (patch)
tree848fb4678cade899d3815b7092f34f9b5c8239eb /gcc/system.h
parentb209d905f5ce1fa9d76ce634fd54245ff340960b (diff)
downloadgcc-77772f8a3da8ea30066d2201f8148714a8e89da5.zip
gcc-77772f8a3da8ea30066d2201f8148714a8e89da5.tar.gz
gcc-77772f8a3da8ea30066d2201f8148714a8e89da5.tar.bz2
c++: Stream DECL_CONTEXT for template template parms [PR98881]
When streaming in a nested template-template parameter as in the attached testcase, we end up reaching the containing template-template parameter in 'tpl_parms_fini'. We should not set the DECL_CONTEXT to this (nested) template-template parameter, as it should already be the struct that the outer template-template parameter is declared on. The precise logic for what DECL_CONTEXT should be for a template template parameter in various situations seems rather obscure. Rather than trying to determine the assumptions that need to hold, it seems simpler to just always re-stream the DECL_CONTEXT as needed for now. PR c++/98881 gcc/cp/ChangeLog: * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT for template template parameters. (trees_in::tpl_parms_fini): Read it. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-tpl-parm-3.h: New test. * g++.dg/modules/tpl-tpl-parm-3_a.H: New test. * g++.dg/modules/tpl-tpl-parm-3_b.C: New test. * g++.dg/modules/tpl-tpl-parm-3_c.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/system.h')
0 files changed, 0 insertions, 0 deletions