Hi! This got broken with r12-3529 and fixed with r12-5255.
Tested on x86_64-linux, committed to trunk as obvious. 2022-03-22 Jakub Jelinek <ja...@redhat.com> PR c++/102489 * g++.dg/coroutines/pr102489.C: New test. --- gcc/testsuite/g++.dg/coroutines/pr102489.C.jj 2022-03-22 15:34:00.372804315 +0100 +++ gcc/testsuite/g++.dg/coroutines/pr102489.C 2022-03-22 15:35:06.205900644 +0100 @@ -0,0 +1,16 @@ +// PR c++/102489 +// { dg-do compile } +// { dg-additional-options "-O" } + +#include <coroutine> + +struct footask { + struct promise_type { + std::suspend_never initial_suspend(); + std::suspend_never final_suspend() noexcept; + void unhandled_exception(); + void get_return_object(); + }; + std::suspend_always foo; + footask taskfun() { co_await foo; } +}; Jakub