https://compiler-explorer.com/z/aWE1Y3zdT is transformed into https://compiler-explorer.com/z/M4ovrnhda
the first outputs:
get_return_object()
~promise_type()
the second outputs:
~promise_type()
get_return_object()
calling get_return_object() on a destroyed object
/* Call the made up function with the coroutine body for initial suspend.
This function will be called subsequently by coroutine_handle<>::resume()
which calls __builtin_coro_resume(__handle_) */
__fooResume(__f);
return __f->__promise.get_return_object();
should have been
/*NRVO is mandatory for this assignment*/
auto __coro_gro=__f->__promise.get_return_object();
/* Call the made up function with the coroutine body for initial suspend.
This function will be called subsequently by coroutine_handle<>::resume()
which calls __builtin_coro_resume(__handle_) */
__fooResume(__f);
return __coro_gro;
https://compiler-explorer.com/z/aWE1Y3zdT is transformed into https://compiler-explorer.com/z/M4ovrnhda
the first outputs:
the second outputs:
calling get_return_object() on a destroyed object
should have been