https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109357
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:618b90f5688fa7c0923a3e07a0741c6ede0e6e4e commit r12-9445-g618b90f5688fa7c0923a3e07a0741c6ede0e6e4e Author: Jason Merrill <ja...@redhat.com> Date: Fri Apr 14 22:40:43 2023 -0400 c++: constexpr aggregate destruction [PR109357] We were assuming that the result of evaluation of TARGET_EXPR_INITIAL would always be the new value of the temporary, but that's not necessarily true when the initializer is complex (i.e. target_expr_needs_replace). In that case evaluating the initializer initializes the temporary as a side-effect. PR c++/109357 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]: Check for complex initializer. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/constexpr-dtor15.C: New test.