diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-06-15 19:43:36 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-06-15 19:43:36 +0000 |
commit | e512155cf60dfc7500625795ce5c1be29044a514 (patch) | |
tree | fea911a0b2ca3132faf884a631f929afb311b721 /lib/AST | |
parent | d5b5a8fae59b609c5e26c63c9e39b8441aa1085d (diff) |
[coroutines] Allow co_await and co_yield expressions that return an lvalue to compile
Summary:
The title says it all.
Reviewers: GorNishanov, rsmith
Reviewed By: GorNishanov
Subscribers: rjmccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D34194
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ExprClassification.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp index c035a42439..d149bdd0cd 100644 --- a/lib/AST/ExprClassification.cpp +++ b/lib/AST/ExprClassification.cpp @@ -190,7 +190,6 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { case Expr::ArrayInitIndexExprClass: case Expr::NoInitExprClass: case Expr::DesignatedInitUpdateExprClass: - case Expr::CoyieldExprClass: return Cl::CL_PRValue; // Next come the complicated cases. @@ -414,7 +413,8 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { return ClassifyInternal(Ctx, cast<InitListExpr>(E)->getInit(0)); case Expr::CoawaitExprClass: - return ClassifyInternal(Ctx, cast<CoawaitExpr>(E)->getResumeExpr()); + case Expr::CoyieldExprClass: + return ClassifyInternal(Ctx, cast<CoroutineSuspendExpr>(E)->getResumeExpr()); } llvm_unreachable("unhandled expression kind in classification"); |