]> gcc.gnu.org Git - gcc.git/commit
c++: Set DECL_CONTEXT for __cxa_thread_atexit [PR99187]
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 16 Nov 2023 21:39:53 +0000 (08:39 +1100)
committerNathan Sidwell <nathan@acm.org>
Sun, 19 Nov 2023 21:43:01 +0000 (16:43 -0500)
commiteaeaad3fcac4d7a30b5a256410cb59fa1a3fa9dd
treef14a39754f63844414ff1cabb2410386560e37f7
parentc177f28d601408180fdb2db0d5ba89d53b370b5e
c++: Set DECL_CONTEXT for __cxa_thread_atexit [PR99187]

Modules streaming requires DECL_CONTEXT to be set on declarations that
are streamed. This ensures that __cxa_thread_atexit is given translation
unit context much like is already done with many other support
functions.

PR c++/99187

gcc/cp/ChangeLog:

* cp-tree.h (enum cp_tree_index): Add CPTI_THREAD_ATEXIT.
(thread_atexit_node): New.
* decl.cc (get_thread_atexit_node): Cache in thread_atexit_node.

gcc/testsuite/ChangeLog:

* g++.dg/modules/pr99187.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Signed-off-by: Nathan Sidwell <nathan@acm.org>
gcc/cp/cp-tree.h
gcc/cp/decl.cc
gcc/testsuite/g++.dg/modules/pr99187.C [new file with mode: 0644]
This page took 0.071066 seconds and 6 git commands to generate.