diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/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()); diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp --- a/clang/test/SemaCXX/coroutines.cpp +++ b/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::promise_type'}} + co_yield 0; } struct promise; // expected-note {{forward declaration}} @@ -476,7 +476,6 @@ // expected-note@-1 {{call to 'initial_suspend' implicitly required by the initial suspend point}} // expected-note@+1 {{function is a coroutine due to use of 'co_await' here}} co_await transform_awaitable{}; - // expected-error@-1 {{no member named 'await_ready'}} } template coro dep_mem_fn(U u) { co_await u; } @@ -494,7 +493,6 @@ //expected-note@-1 {{call to 'initial_suspend' implicitly required by the initial suspend point}} //expected-note@+1 {{function is a coroutine due to use of 'co_await' here}} co_await transform_awaitable{}; - // expected-error@-1 {{no member named 'await_ready'}} } void operator co_await(transform_awaitable) = delete;