[Bug c++/125210] [14/15/16/17 Regression] [coroutines] Change in coroutine frame destruction behavior on exception since 14.3

bootmgr at 163 dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.