[PATCH] D81885: [Coroutines] Return false on error of buildSuspends
Xun Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 15 18:14:15 PDT 2020
lxfind updated this revision to Diff 270929.
lxfind added a comment.
Adjust tests
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81885/new/
https://reviews.llvm.org/D81885
Files:
clang/lib/Sema/SemaCoroutine.cpp
clang/test/SemaCXX/coroutines.cpp
Index: clang/test/SemaCXX/coroutines.cpp
===================================================================
--- clang/test/SemaCXX/coroutines.cpp
+++ clang/test/SemaCXX/coroutines.cpp
@@ -103,7 +103,7 @@
struct promise_type {};
};
double bad_promise_type_2(int) { // expected-error {{no member named 'initial_suspend'}}
- co_yield 0; // expected-error {{no member named 'yield_value' in 'std::experimental::coroutine_traits<double, int>::promise_type'}}
+ co_yield 0;
}
struct promise; // expected-note {{forward declaration}}
@@ -476,7 +476,6 @@
// expected-note at -1 {{call to 'initial_suspend' implicitly required by the initial suspend point}}
// expected-note at +1 {{function is a coroutine due to use of 'co_await' here}}
co_await transform_awaitable{};
- // expected-error at -1 {{no member named 'await_ready'}}
}
template <class R, class U>
coro<R> dep_mem_fn(U u) { co_await u; }
@@ -494,7 +493,6 @@
//expected-note at -1 {{call to 'initial_suspend' implicitly required by the initial suspend point}}
//expected-note at +1 {{function is a coroutine due to use of 'co_await' here}}
co_await transform_awaitable{};
- // expected-error at -1 {{no member named 'await_ready'}}
}
void operator co_await(transform_awaitable) = delete;
Index: clang/lib/Sema/SemaCoroutine.cpp
===================================================================
--- clang/lib/Sema/SemaCoroutine.cpp
+++ clang/lib/Sema/SemaCoroutine.cpp
@@ -643,11 +643,11 @@
StmtResult InitSuspend = buildSuspends("initial_suspend");
if (InitSuspend.isInvalid())
- return true;
+ return false;
StmtResult FinalSuspend = buildSuspends("final_suspend");
if (FinalSuspend.isInvalid())
- return true;
+ return false;
ScopeInfo->setCoroutineSuspends(InitSuspend.get(), FinalSuspend.get());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81885.270929.patch
Type: text/x-patch
Size: 1851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200616/28a4c903/attachment.bin>
More information about the cfe-commits
mailing list