Destroy the awaitable's frame as the result is consumed.

This change works around a gcc 10 bug, where the temporary awaitable
object being awaited is not destroyed if the co_await resumes with an
exception.
This commit is contained in:
Christopher Kohlhoff 2020-07-23 12:23:57 +10:00
parent 61e62436ea
commit b956b35379

View File

@ -100,7 +100,7 @@ public:
// Support for co_await keyword.
T await_resume()
{
return frame_->get();
return awaitable(static_cast<awaitable&&>(*this)).frame_->get();
}
#endif // !defined(GENERATING_DOCUMENTATION)