summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprClassification.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-05-21 21:04:55 +0000
committerDouglas Gregor <dgregor@apple.com>2011-05-21 21:04:55 +0000
commitb7c36f6c681f22c413b5e27d1aeeeaff80889f76 (patch)
treecdd56872bfbdad9e6001820d1cf6bd89d6f33175 /clang/lib/AST/ExprClassification.cpp
parent5ec65765e6c19c19f3d4a1ad4938e7ccf24177e1 (diff)
downloadbcm5719-llvm-b7c36f6c681f22c413b5e27d1aeeeaff80889f76.tar.gz
bcm5719-llvm-b7c36f6c681f22c413b5e27d1aeeeaff80889f76.zip
Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>. llvm-svn: 131810
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r--clang/lib/AST/ExprClassification.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp
index 888a93c8aac..7e4d06ac307 100644
--- a/clang/lib/AST/ExprClassification.cpp
+++ b/clang/lib/AST/ExprClassification.cpp
@@ -465,14 +465,16 @@ static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
// is a pointer to a data member is of the same value category as its first
// operand.
if (E->getOpcode() == BO_PtrMemD)
- return E->getType()->isFunctionType() ? Cl::CL_MemberFunction :
- ClassifyInternal(Ctx, E->getLHS());
+ return (E->getType()->isFunctionType() || E->getType() == Ctx.BoundMemberTy)
+ ? Cl::CL_MemberFunction
+ : ClassifyInternal(Ctx, E->getLHS());
// C++ [expr.mptr.oper]p6: The result of an ->* expression is an lvalue if its
// second operand is a pointer to data member and a prvalue otherwise.
if (E->getOpcode() == BO_PtrMemI)
- return E->getType()->isFunctionType() ?
- Cl::CL_MemberFunction : Cl::CL_LValue;
+ return (E->getType()->isFunctionType() || E->getType() == Ctx.BoundMemberTy)
+ ? Cl::CL_MemberFunction
+ : Cl::CL_LValue;
// All other binary operations are prvalues.
return Cl::CL_PRValue;
OpenPOWER on IntegriCloud