summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-04-27 00:36:17 +0000
committerJohn McCall <rjmccall@apple.com>2011-04-27 00:36:17 +0000
commit4adb38cdf4004057417422af15c863f8cd3c34ff (patch)
tree6c5cc009e4271d5754241f14c177872513fcdee5 /clang/lib/Sema/SemaOverload.cpp
parent30ee16f5ddbdf990197dce788b12c9a47e26cc81 (diff)
downloadbcm5719-llvm-4adb38cdf4004057417422af15c863f8cd3c34ff.tar.gz
bcm5719-llvm-4adb38cdf4004057417422af15c863f8cd3c34ff.zip
FixOverloadedFunctionReference needs to rebuild member accesses of
instance methods to have bound-member type. Fixing that broke __unknown_anytype, which I've in turn fixed. llvm-svn: 130266
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 2e85263ce3c..5776820ab04 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -9274,6 +9274,16 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
} else
Base = MemExpr->getBase();
+ ExprValueKind valueKind;
+ QualType type;
+ if (cast<CXXMethodDecl>(Fn)->isStatic()) {
+ valueKind = VK_LValue;
+ type = Fn->getType();
+ } else {
+ valueKind = VK_RValue;
+ type = Context.BoundMemberTy;
+ }
+
return MemberExpr::Create(Context, Base,
MemExpr->isArrow(),
MemExpr->getQualifierLoc(),
@@ -9281,10 +9291,7 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
Found,
MemExpr->getMemberNameInfo(),
TemplateArgs,
- Fn->getType(),
- cast<CXXMethodDecl>(Fn)->isStatic()
- ? VK_LValue : VK_RValue,
- OK_Ordinary);
+ type, valueKind, OK_Ordinary);
}
llvm_unreachable("Invalid reference to overloaded function");
OpenPOWER on IntegriCloud