Skip to content

Commit 882a527

Browse files
committed
fix task_tests
1 parent 667be09 commit 882a527

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/task_tests.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,25 @@ TEST_CASE("task of reference type")
138138
SUBCASE("awaiting rvalue task")
139139
{
140140
decltype(auto) result = co_await f();
141+
// MSVC 19.xx fails to handle this assertion
142+
// making all the test file failing to compile with weird errors
143+
#if !CPPCORO_COMPILER_MSVC || CPPCORO_COMPILER_MSVC < 19'00'00000
141144
static_assert(
142145
std::is_same<decltype(result), int&>::value,
143146
"co_await r-value reference of task<int&> should result in an int&");
147+
#endif
144148
CHECK(&result == &value);
145149
}
146150

147151
SUBCASE("awaiting lvalue task")
148152
{
149153
auto t = f();
150154
decltype(auto) result = co_await t;
155+
#if !CPPCORO_COMPILER_MSVC || CPPCORO_COMPILER_MSVC < 19'00'00000
151156
static_assert(
152157
std::is_same<decltype(result), int&>::value,
153158
"co_await l-value reference of task<int&> should result in an int&");
159+
#endif
154160
CHECK(&result == &value);
155161
}
156162
}());

0 commit comments

Comments
 (0)