From 7af4ec744e30d573482aef7a37089d0d32cc07ef Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 5 Jan 2010 05:04:05 +0000 Subject: When emitting member function pointers, use the canonical decl if the member function is virtual. Fixes PR5940. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92680 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/CodeGen/CGExprConstant.cpp') diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 3236d3950e..d1330e066d 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -408,6 +408,8 @@ public: llvm::Constant *EmitMemberFunctionPointer(CXXMethodDecl *MD) { assert(MD->isInstance() && "Member function must not be static!"); + MD = MD->getCanonicalDecl(); + const llvm::Type *PtrDiffTy = CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType()); -- cgit v1.2.3