The promises winrt::fire_and_forget and winrt::impl::promise_base have the member function await_transform which uses winrt::impl::notify_awaiter, which uses winrt::impl::get_awaiter, which in turn uses winrt::impl::awaiter_finder.
When you do things like co_await 10ms in a coroutine with one of these promise types, the await_transform member function is called, and the operator co_await for std::chrono::duration is resolved by winrt::impl::get_awaiter using winrt::impl::awaiter_finder.
This works in MSVC, however Clang and GCC don't like it when the operator co_await is not declared before the definition of the awaiter_finder template class: https://godbolt.org/z/hbhhMdj3d
I believe this is the reason why some of the tests using co_await does not work on Clang without these workarounds in #1203.
Any ideas? I cannot tell which compilers are doing it wrong.
The promises
winrt::fire_and_forgetandwinrt::impl::promise_basehave the member functionawait_transformwhich useswinrt::impl::notify_awaiter, which useswinrt::impl::get_awaiter, which in turn useswinrt::impl::awaiter_finder.When you do things like
co_await 10msin a coroutine with one of these promise types, theawait_transformmember function is called, and theoperator co_awaitforstd::chrono::durationis resolved bywinrt::impl::get_awaiterusingwinrt::impl::awaiter_finder.This works in MSVC, however Clang and GCC don't like it when the
operator co_awaitis not declared before the definition of theawaiter_findertemplate class: https://godbolt.org/z/hbhhMdj3dI believe this is the reason why some of the tests using
co_awaitdoes not work on Clang without these workarounds in #1203.Any ideas? I cannot tell which compilers are doing it wrong.