https://compiler-explorer.com/z/eM8snj1o3 transforms into https://compiler-explorer.com/z/G5K9fbqjd
the first outputs
loud_awaiter<0x598253c312c8>()=0x598253c312c8
~loud_awaiter<0x598253c312c8>()=0x598253c312c8
loud_awaiter<0x598253c312d0>()=0x598253c312d0
~loud_awaiter<0x598253c312d0>()=0x598253c312d0
the second outputs
loud_awaiter<0x7ffe0cc33dd8>()=0x7ffe0cc33dd8
loud_awaiter<0x5a29082b42d0>&operator=(loud_awaiter<0x7ffe0cc33dd8>&&)=0x7ffe0cc33dd8
~loud_awaiter<0x7ffe0cc33dd8>()=0
loud_awaiter<0x7ffe0cc33d78>()=0x7ffe0cc33d78
loud_awaiter<0x5a29082b42d8>&operator=(loud_awaiter<0x7ffe0cc33d78>&&)=0x7ffe0cc33d78
~loud_awaiter<0x7ffe0cc33d78>()=0
~loud_awaiter<0x5a29082b42d8>()=0x7ffe0cc33d78
~loud_awaiter<0x5a29082b42d0>()=0x7ffe0cc33dd8
__f->__suspend_62_12 = loud_awaiter{create_tag_t(create_tag)};
if(!__f->__suspend_62_12.await_ready()) {
__f->__suspend_index = 2;
__f->__suspend_62_12.await_suspend(std::coroutine_handle<Task::promise_type>::from_address(static_cast<void *>(__f)).operator std::coroutine_handle<void>());
return;
}
__resume_foo_2:
__f->__suspend_62_12.await_resume();
should be (ignoring exception-handling)
new(&(__f->__suspend_62_12))loud_awaiter{create_tag_t(create_tag)};
if(!__f->__suspend_62_12.await_ready()) {
__f->__suspend_index = 2;
__f->__suspend_62_12.await_suspend(std::coroutine_handle<Task::promise_type>::from_address(static_cast<void *>(__f)).operator std::coroutine_handle<void>());
return;
}
__resume_foo_2:
__f->__suspend_62_12.await_resume();
__f->__suspend_62_12.~loud_awaiter();
https://compiler-explorer.com/z/eM8snj1o3 transforms into https://compiler-explorer.com/z/G5K9fbqjd
the first outputs
the second outputs
should be (ignoring exception-handling)