Handle CXXMemberCallExprs that point to a static method. Fixes PR5093.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83045 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index e37b4a8..bf9af9c 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -202,6 +202,14 @@
const MemberExpr *ME = cast<MemberExpr>(CE->getCallee());
const CXXMethodDecl *MD = cast<CXXMethodDecl>(ME->getMemberDecl());
+ if (MD->isStatic()) {
+ // The method is static, emit it as we would a regular call.
+ llvm::Value *Callee = CGM.GetAddrOfFunction(MD);
+ return EmitCall(Callee, getContext().getPointerType(MD->getType()),
+ CE->arg_begin(), CE->arg_end(), 0);
+
+ }
+
const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
const llvm::Type *Ty =