Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Clang/GCC: Issue with operator co_await and winrt::impl::awaiter_finder #1219

Copy link
Copy link
@alvinhochun

Description

@alvinhochun
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.