diff options
author | Gor Nishanov <GorNishanov@gmail.com> | 2017-01-10 00:08:31 +0000 |
---|---|---|
committer | Gor Nishanov <GorNishanov@gmail.com> | 2017-01-10 00:08:31 +0000 |
commit | d97f6bfbb1fa896749a223a62181218af2f5dd69 (patch) | |
tree | 5c7fac9db5a2868a47e24cf9a630f46f16c3a280 /clang/lib/Sema/SemaCoroutine.cpp | |
parent | 43a833bec47b9eb43cd57ef61256b1a287ee32c2 (diff) | |
download | bcm5719-llvm-d97f6bfbb1fa896749a223a62181218af2f5dd69.tar.gz bcm5719-llvm-d97f6bfbb1fa896749a223a62181218af2f5dd69.zip |
[coroutines] Sema: Allow co_return all by itself.
Reviewers: rsmith, EricWF
Subscribers: mehdi_amini, llvm-commits, EricWF
Differential Revision: https://reviews.llvm.org/D26038
llvm-svn: 291513
Diffstat (limited to 'clang/lib/Sema/SemaCoroutine.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCoroutine.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index 3109358df46..f6115c1bee6 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -578,17 +578,6 @@ void Sema::CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body) { isa<CoyieldExpr>(First) ? 1 : 2); } - bool AnyCoawaits = false; - bool AnyCoyields = false; - for (auto *CoroutineStmt : Fn->CoroutineStmts) { - AnyCoawaits |= isa<CoawaitExpr>(CoroutineStmt); - AnyCoyields |= isa<CoyieldExpr>(CoroutineStmt); - } - - if (!AnyCoawaits && !AnyCoyields) - Diag(Fn->CoroutineStmts.front()->getLocStart(), - diag::ext_coroutine_without_co_await_co_yield); - SourceLocation Loc = FD->getLocation(); // Form a declaration statement for the promise declaration, so that AST |