https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96876
--- Comment #2 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:53cac72cf0821217f99d0640ba72cc2999ec7dc0 commit r12-7117-g53cac72cf0821217f99d0640ba72cc2999ec7dc0 Author: Jason Merrill <ja...@redhat.com> Date: Fri Feb 4 18:25:51 2022 -0500 c++: cleanup constant-init'd members [PR96876] This is a case missed by my recent fixes to aggregate initialization and exception cleanup for PR94041 et al: we also need to clean up members with constant initialization if initialization of a later member throws. It also occurs to me that we needn't bother building the cleanups if -fno-exceptions; build_vec_init already doesn't. PR c++/96876 gcc/cp/ChangeLog: * typeck2.cc (split_nonconstant_init_1): Push cleanups for preceding members with constant initialization. (maybe_push_temp_cleanup): Do nothing if -fno-exceptions. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/aggr-base11.C: New test. * g++.dg/eh/aggregate2.C: New test.