summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2017-05-24 15:44:57 +0000
committerGor Nishanov <GorNishanov@gmail.com>2017-05-24 15:44:57 +0000
commitafff89eecb20d8b7796a8d84fa30d9d06940050c (patch)
tree368399a88169aae7f31d6d0dd0219e0fc53ac21d /clang/lib/Sema/SemaLambda.cpp
parentd6f179cad6c93a517d3ab62ed61680678365cde3 (diff)
downloadbcm5719-llvm-afff89eecb20d8b7796a8d84fa30d9d06940050c.tar.gz
bcm5719-llvm-afff89eecb20d8b7796a8d84fa30d9d06940050c.zip
[coroutines] Make generic lambda coroutines work
Summary: 1. Coroutine cannot be constexpr (added a check in SemaLambda.cpp not to mark coroutine as constexpr) 2. TransformCoroutineBodyStmt should transform ResultDecl and ReturnStmt Reviewers: rsmith, GorNishanov Reviewed By: GorNishanov Subscribers: EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D33498 llvm-svn: 303764
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 7a9a8ff911a..4b1d7fd3cf2 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -1591,6 +1591,7 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc,
// its constexpr-ness, supressing diagnostics while doing so.
if (getLangOpts().CPlusPlus1z && !CallOperator->isInvalidDecl() &&
!CallOperator->isConstexpr() &&
+ !isa<CoroutineBodyStmt>(CallOperator->getBody()) &&
!Class->getDeclContext()->isDependentContext()) {
TentativeAnalysisScope DiagnosticScopeGuard(*this);
CallOperator->setConstexpr(
OpenPOWER on IntegriCloud