-
Notifications
You must be signed in to change notification settings - Fork 262
Clang conformance #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang conformance #779
Conversation
| template <typename> static constexpr bool find_co_await_free(...) { return false; } | ||
|
|
||
| #ifdef WINRT_IMPL_COROUTINES | ||
| template <typename U, typename = decltype(std::declval<U>().await_ready())> static constexpr bool find_awaitable_member(int) { return true; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't mention operator co_await and could stay in its original location, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just cleaner to group the trues and falses together.
| template <typename T> | ||
| decltype(auto) get_awaiter(T&& value) noexcept | ||
| { | ||
| #ifdef WINRT_IMPL_COROUTINES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this #ifdef any more. has_co_await_member and has_co_await_free will always be false if WINRT_IMPL_COROUTINES is not defined, so we fall through to the last case, which requires the type to be its own awaiter (and if we move the find_awaitable_member outside the #ifdef it will work), it will look for an await_ready which is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, Clang currently looks inside the if constexpr regardless and fails to compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, forgot about that. Even though it's if constexpr'd out, it still has to compile.
Fixes #566
Looks like Clang defines
__cpp_coroutinesbut not__cpp_lib_coroutineas it should. Anyway, this fix should tide us over until Clang offers full coroutine support. This change justifdefs away the mentions ofoperator co_awaitifWINRT_IMPL_COROUTINESis not defined.Also, silenced a few more warnings about dependent template names.