Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7513d9c

Browse files
committed
Remove hack workaround for co_return <void-expr> under clang.
This bug has been fixed in clang-6.0.
1 parent dbfa380 commit 7513d9c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/cppcoro/shared_lazy_task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ namespace cppcoro
513513
co_return co_await std::move(t);
514514
}
515515

516-
#if defined(_MSC_VER) && _MSC_FULL_VER <= 191025019 || CPPCORO_COMPILER_CLANG
516+
#if defined(_MSC_VER) && _MSC_FULL_VER <= 191025019
517517
// HACK: Workaround for broken MSVC that doesn't execute <expr> in 'co_return <expr>;'.
518518
inline shared_lazy_task<void> make_shared_task(lazy_task<void> t)
519519
{

include/cppcoro/shared_task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ namespace cppcoro
476476
co_return co_await std::move(t);
477477
}
478478

479-
#if defined(_MSC_VER) && _MSC_FULL_VER <= 191025019 || CPPCORO_COMPILER_CLANG
479+
#if defined(_MSC_VER) && _MSC_FULL_VER <= 191025019
480480
// HACK: Work around bug in MSVC handling of 'co_return <expr>' for void-returning expression.
481481
// It doesn't actually evaluate <expr> before calling <promise>.return_void().
482482
inline shared_task<void> make_shared_task(task<void> t)

0 commit comments

Comments
 (0)