Skip to content

Behaviour of an unhandled_exception() method that throws an exception is under-specified #17

Description

@lewissbaker

If a coroutine's promise object throws an exception from promise_type::unhandled_exception() (eg. if it rethrows the current exception), what state is the coroutine left in?

Is the coroutine suspended prior to the exception propagating out of the initial-call/resume-call?

Is the coroutine frame safe to destroy by the caller or is it already destroyed?

Is the promise object destroyed?
The pseudo-code would imply that it is.

Is the coroutine done()?
The definition of done() implies that it's only true if suspended at final_suspend() but control flow of the psuedo-code in [N4663] implies that final_suspend() would be skipped in this case.

Wording of [N4663] section 8.4.4(3) doesn't seem to clearly define semantics of this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions