https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510
--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Thu Dec 19 14:06:45 2019 New Revision: 279576 URL: https://gcc.gnu.org/viewcvs?rev=279576&root=gcc&view=rev Log: PR c++/66139 - EH cleanups for partially constructed aggregates. There were several overlapping PRs about failure to clean up fully constructed subobjects when an exception is thrown during aggregate initialization of a temporary. I fixed this for non-temporaries in the context of 57510, but that fix didn't handle temporaries. So this patch does split_nonconstant_init at gimplification time, which is much smaller than alternatives I tried. PR c++/57510 * cp-gimplify.c (cp_gimplify_init_expr): Use split_nonconstant_init. * typeck2.c (split_nonconstant_init): Handle non-variable dest. (split_nonconstant_init_1): Clear TREE_SIDE_EFFECTS. * tree.c (is_local_temp): New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/initlist116.C trunk/gcc/testsuite/g++.dg/cpp0x/initlist117.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-gimplify.c trunk/gcc/cp/cp-tree.h trunk/gcc/cp/tree.c trunk/gcc/cp/typeck2.c trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh.C