c++: cleanup function name [PR 98531]
authorNathan Sidwell <nathan@acm.org>
Wed, 3 Feb 2021 12:44:41 +0000 (04:44 -0800)
committerNathan Sidwell <nathan@acm.org>
Mon, 8 Feb 2021 17:24:39 +0000 (09:24 -0800)
commitefcd941e86b507d77e90a1b13f621e036eacdb45
treed71e89481b7c698f8f637cce70e001db66e173cd
parent57b17858a1b3719507ccad926fb57b05f26935f8
c++: cleanup function name [PR 98531]

The next piece of 98531 is that in some cases we need to create a
cleanup function to do the work (when the object is an array, or we're
using regular atexit).  We were not pushing that function's decl
anywhere (not giving it a context) so streaming it failed.

This is a partial fix.  You'll notice we're naming these from a per-TU
counter.  I've captured that in PR98893.

gcc/cp/
* decl.c (start_cleanup_fn): Push function into
namespace.
gcc/testsuite/
* g++.dg/modules/pr98531-2.h: New.
* g++.dg/modules/pr98531-2_a.H: New.
* g++.dg/modules/pr98531-2_b.C: New.
* g++.dg/modules/pr98531-3.h: New.
* g++.dg/modules/pr98531-3_a.H: New.
* g++.dg/modules/pr98531-3_b.C: New.
gcc/cp/decl.c
gcc/testsuite/g++.dg/modules/pr98531-2.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98531-2_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98531-2_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98531-3.h [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98531-3_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98531-3_b.C [new file with mode: 0644]