https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125210
--- Comment #4 from bootmgr at 163 dot com <bootmgr at 163 dot com> --- > It's not clear what the correct > behavior is. This exact wording question is tracked as CWG2934 (https://cplusplus.github.io/CWG/issues/2934.html). CWG2934 notes that existing implementations destroy the promise object, followed by the parameter copies, and then deallocate the coroutine state when unhandled_exception() exits via an exception. This is the expected behavior based on [dcl.fct.def.coroutine]/5 . The GCC 14.2 behavior is the intended behavior. The GCC 14.3 and later behavior, where the promise destructor is not called and the coroutine state is leaked, is incorrect.
