c++: fix array cleanup with throwing temp dtor
While working on PR66139 I noticed that if the destructor of a temporary created during array initialization throws, we were failing to destroy the last array element constructed. Throwing destructors are rare since C++11, but this should be fixed. gcc/cp/ChangeLog: * init.c (build_vec_init): Append the decrement to elt_init. gcc/testsuite/ChangeLog: * g++.dg/eh/array2.C: New test.
Loading
Please register or sign in to comment