https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114005
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:2823b4d96d9ec4ad4e67e5e8edaa1b060a467491 commit r14-9266-g2823b4d96d9ec4ad4e67e5e8edaa1b060a467491 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Thu Feb 29 22:49:13 2024 +1100 c++: Ensure DECL_CONTEXT is set for temporary vars [PR114005] Modules streaming requires DECL_CONTEXT to be set for anything streamed. This patch ensures that 'create_temporary_var' does set a DECL_CONTEXT for these variables (such as the backing storage for initializer_lists) even if not inside a function declaration. PR c++/114005 gcc/cp/ChangeLog: * init.cc (create_temporary_var): Use current_scope instead of current_function_decl. gcc/testsuite/ChangeLog: * g++.dg/modules/pr114005_a.C: New test. * g++.dg/modules/pr114005_b.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>