aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-02-07 00:15:38 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-02-07 00:15:38 +0000
commit224605064a4ef87d1c3d35ad1cb363f8b534012b (patch)
treee8a4fd33c2d0cf29e5bf199b46456fde514ff7d9 /lib/AST/Expr.cpp
parent63b4fe6c118c14707d297f6f879e5e7973b8e6ff (diff)
Implement dereferencing of pointers-to-member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index d627ab03b2..89fdbe31f3 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -496,6 +496,12 @@ Expr::isLvalueResult Expr::isLvalue(ASTContext &Ctx) const {
BinOp->getOpcode() == BinaryOperator::Comma)
return BinOp->getRHS()->isLvalue(Ctx);
+ // C++ [expr.mptr.oper]p6
+ if ((BinOp->getOpcode() == BinaryOperator::PtrMemD ||
+ BinOp->getOpcode() == BinaryOperator::PtrMemI) &&
+ !BinOp->getType()->isFunctionType())
+ return BinOp->getLHS()->isLvalue(Ctx);
+
if (!BinOp->isAssignmentOp())
return LV_InvalidExpression;