https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120453
--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #6) > Interesting if I change the lambda into a normal function: > ``` > auto coro() ->LazyTask<int> > { > co_await []() -> Task<int> {}(); > } > ``` > > GCC 15 rejects it and then ICEs: > ``` > <source>: In function 'QCoro::LazyTask<int> QCoro::coro()': > <source>:81:39: error: wrong number of template arguments (1, should be 2) > 81 | co_await []() -> Task<int> {}(); > | ^ > <source>:6:46: note: provided for 'template<class _Result, class> struct > std::coroutine_traits' > 6 | template <typename _Result, typename> struct coroutine_traits : > _Result {}; > | ^~~~~~~~~~~~~~~~ > <source>:81:9: error: cannot instantiate 'coroutine traits' > 81 | co_await []() -> Task<int> {}(); > | ^~~~~~~~ > ``` this second observation is possibly a dup; (but need to check) with lambdas we reach finish_function before the closure is finished - and IIRC that puts us into a problem with complete_type_or_else. I had a discussion with Jason about that and have on my TODO to attempt to alter the finishing of the closure object before the finish_function for the lambda (since the closure object content is actually known at that point).