On 9/15/26 10:42 PM, Joshua Berne wrote:
Attached is a patch for PR127281. I added testing to an existing test
in order to explore more adjacent corners and capture a runtime failure
that was hiding behind the ICE. When there were two effective blocks in
a function the compiler ICEd because of two conflicting declarations for
the return value cleanup sentinel. With no intervening declaration,
there were two destructors calls if an exception escaped the destruction
of temporaries.
There's another followup bug (127414) that requires additional cleanup
steps to be added to handle proper exceptions escaping from
postcondition evaluations. Right now we leak or double destroy, this
fix makes it all just leak, and the fix to 127414 looks like it will
depend on this fix as well.
I ran the full dg test suite (check=g++ and check-gcc) before and
aftetr, no new tests failed and 3 new tests passed (the runtime testing
that i added for the existing test).
Hmm, this seems like a bandaid until the future 127414 patch actually
fixes the interaction between contracts and the return cleanup. I'm
open to applying it anyway, but both the commit message and the code
comment should make that clear.
Jason