https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104182
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:9718bc4b03c1a94f7cf64860bbc828aa53c56234 commit r12-6822-g9718bc4b03c1a94f7cf64860bbc828aa53c56234 Author: Jason Merrill <ja...@redhat.com> Date: Sat Jan 22 17:11:54 2022 -0500 c++: array temporary at file scope [PR104182] This is the same issue as PR104031, but that patch doesn't fix this testcase because in this case, current_function_decl isn't set when we get to cp_genericize_target_expr. But there seems to be no need for is_local_temp to check for function scope; !TREE_STATIC should be enough. PR c++/104182 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing has set DECL_INITIAL on a TARGET_EXPR slot. * tree.cc (is_local_temp): Don't check DECL_CONTEXT. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist127.C: New test.