diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-22 05:46:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-22 05:46:06 +0000 |
commit | 88a3514f36de96b19cdf50141c640df1a5f13f6c (patch) | |
tree | a15713eacba3dc51acc9af629d852ace77db9ea7 /lib/AST/Expr.cpp | |
parent | b595509bf5c07b65616d9c7ef26dca4858768ac7 (diff) |
Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
member functions in the overload set.
- The call may or may not have an implicit object argument,
depending on the syntax (x.f() vs. f()) and the context (static
vs. non-static member function).
- We now generate MemberExprs for implicit member access expression.
- We now cope with mutable whenever we're building MemberExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index adad2a472a..6cfcdc4914 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -487,16 +487,17 @@ Expr::isLvalueResult Expr::isLvalue(ASTContext &Ctx) const { return LV_InvalidExpression; } case CallExprClass: - case CXXOperatorCallExprClass: { + case CXXOperatorCallExprClass: + case CXXMemberCallExprClass: { // C++ [expr.call]p10: // A function call is an lvalue if and only if the result type // is a reference. QualType CalleeType = cast<CallExpr>(this)->getCallee()->getType(); if (const PointerType *FnTypePtr = CalleeType->getAsPointerType()) - if (const FunctionType *FnType - = FnTypePtr->getPointeeType()->getAsFunctionType()) - if (FnType->getResultType()->isReferenceType()) - return LV_Valid; + CalleeType = FnTypePtr->getPointeeType(); + if (const FunctionType *FnType = CalleeType->getAsFunctionType()) + if (FnType->getResultType()->isReferenceType()) + return LV_Valid; break; } |