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@-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 <class R, class U> coro<R> 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; 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());
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@-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 <class R, class U> coro<R> 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; 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());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits