https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99187
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nat...@gcc.gnu.org>: https://gcc.gnu.org/g:eaeaad3fcac4d7a30b5a256410cb59fa1a3fa9dd commit r14-5598-geaeaad3fcac4d7a30b5a256410cb59fa1a3fa9dd Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Fri Nov 17 08:39:53 2023 +1100 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 <nathanielosh...@gmail.com> Signed-off-by: Nathan Sidwell <nat...@acm.org>