https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97433
Bug ID: 97433 Summary: C++20 Coroutines, Unexpected reordering of await_resume, return_value and yield_value Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: davidledger at live dot com.au Target Milestone: --- Critical components of c++20 coroutines are being reordered. This means that for Task types that return values using co_return and co_yield there is likely incorrect results. LLVM does not have this issue. MSVC behaves the same as GCC. I've outlined this problem in detail here: https://stackoverflow.com/questions/64348125/c20-coroutines-unexpected-reordering-of-await-resume-return-value-and-yield The problem can be seen here, but the explaination is in the stack overflow post: https://godbolt.org/z/7rn5jz (It let me format the post nicely)