Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion strings/base_coroutine_foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ WINRT_EXPORT namespace winrt
template <typename... T>
Windows::Foundation::IAsyncAction when_all(T... async)
{
((co_await async, void()), ...);
(void(co_await async), ...);
co_return;
}

Expand Down
7 changes: 5 additions & 2 deletions test/test/when.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ using namespace concurrency;
using namespace winrt;
using namespace Windows::Foundation;

struct CommaStruct
struct CommaStruct : std::experimental::suspend_never
{
// If the comma operator is invoked, we will get a build failure.
CommaStruct operator,(CommaStruct) = delete;

// Awaiting the object just returns itself.
auto await_resume() const { return *this; }
};

task<void> ppl(bool& done)
Expand Down Expand Up @@ -56,7 +59,7 @@ TEST_CASE("when")
when_all().get();

// Verify edge case of overloaded comma operator (shame on you).
when_all(create_task([] { return CommaStruct{}; }), create_task([] { return CommaStruct{}; })).get();
when_all(CommaStruct{}, CommaStruct{}).get();
{
handle first_event{ check_pointer(CreateEventW(nullptr, true, false, nullptr)) };
handle second_event{ check_pointer(CreateEventW(nullptr, true, false, nullptr)) };
Expand Down