llvm-project
llvm-project copied to clipboard
[Coroutines] Incorrect behavior if symmetric transferred coroutine throws exceptions
The symmetric transfer would enforce the resuming call to be an musttail call. However, it is problematic if there is an exception throw from the resuming call. In this case, we can't catch the exception in the parent function's unhandled_exception()
. Also the parent coroutine couldn't be marked as done, which violates the spec too.
This is showed in: https://godbolt.org/z/eTGd3M37f
@llvm/issue-subscribers-coroutines
It is fine if we don't use symmetric transfer: https://godbolt.org/z/YP3vYsfEE
According to the discussion in WG21, this is consistency with the design intention.