diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-19 07:07:47 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-19 07:07:47 +0000 |
commit | 2d48e7811216b2a2d15dcf7e4be8f73ad48cc60a (patch) | |
tree | 1dba6973b7aa27aeef79f4b8ed7a035bbf12c3c6 /lib/AST/Expr.cpp | |
parent | 17ef1660b209f1a2294b9ddee86846c6fd8d5ec0 (diff) |
A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index dcf4411d85..034b91ed0f 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1213,6 +1213,16 @@ Expr::isLvalueResult Expr::isLvalueInternal(ASTContext &Ctx) const { return LV_Valid; } + case Expr::CXXExprWithTemporariesClass: + return cast<CXXExprWithTemporaries>(this)->getSubExpr()->isLvalue(Ctx); + + case Expr::ObjCMessageExprClass: + if (const ObjCMethodDecl *Method + = cast<ObjCMessageExpr>(this)->getMethodDecl()) + if (Method->getResultType()->isLValueReferenceType()) + return LV_Valid; + break; + default: break; } |