diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-05 05:04:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-05 05:04:05 +0000 |
commit | 7af4ec744e30d573482aef7a37089d0d32cc07ef (patch) | |
tree | 7ac99fbcb9eda074441b747323610eddce1d404d /lib/CodeGen/CGExprConstant.cpp | |
parent | fc4e4e15115e2d973fcc43b2d40e401d3ac88b73 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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()); |