Skip to content

Commit

Permalink
Address a MSVC compiler bug which prevents collapsing references in c…
Browse files Browse the repository at this point in the history
…oroutines

* Closes #2
  • Loading branch information
Naios committed Mar 6, 2018
1 parent 715cece commit d962256
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/unit-test/multi/test-continuable-await.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct coroutine_traits<void, T...> {

/// Resolves the given promise asynchonously
template <typename S, typename T>
void resolve_async(S&& supplier, T&& promise) {
void resolve_async(S&& supplier, T promise) {
// 0 args
co_await supplier();

Expand All @@ -89,9 +89,9 @@ TYPED_TEST(single_dimension_tests, are_awaitable) {
};

EXPECT_ASYNC_RESULT(
this->supply().then(cti::make_continuable<void>([&](auto&& promise) {
this->supply().then(cti::make_continuable<void>([&](auto promise) {
// Resolve the cotinuable through a coroutine
resolve_async(supply, std::forward<decltype(promise)>(promise));
resolve_async(supply, std::move(promise));
})));
}

Expand All @@ -109,7 +109,7 @@ struct await_exception : std::exception {

/// Resolves the given promise asynchonously through an exception
template <typename S, typename T>
void resolve_async_exceptional(S&& supplier, T&& promise) {
void resolve_async_exceptional(S&& supplier, T promise) {
// 0 args
co_await supplier();

Expand Down Expand Up @@ -138,10 +138,9 @@ TYPED_TEST(single_dimension_tests, are_awaitable_with_exceptions) {
};

ASSERT_ASYNC_COMPLETION(
this->supply().then(cti::make_continuable<void>([&](auto&& promise) {
this->supply().then(cti::make_continuable<void>([&](auto promise) {
// Resolve the cotinuable through a coroutine
resolve_async_exceptional(supply,
std::forward<decltype(promise)>(promise));
resolve_async_exceptional(supply, std::move(promise));
})));
}

Expand Down

0 comments on commit d962256

Please sign in to comment.