aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-01-05 05:04:05 +0000
committerAnders Carlsson <andersca@mac.com>2010-01-05 05:04:05 +0000
commit7af4ec744e30d573482aef7a37089d0d32cc07ef (patch)
tree7ac99fbcb9eda074441b747323610eddce1d404d /lib/CodeGen/CGExprAgg.cpp
parentfc4e4e15115e2d973fcc43b2d40e401d3ac88b73 (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/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index b95fd79901..c852d65b85 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -313,7 +313,8 @@ void AggExprEmitter::VisitUnaryAddrOf(const UnaryOperator *E) {
"Unexpected member pointer type!");
const DeclRefExpr *DRE = cast<DeclRefExpr>(E->getSubExpr());
- const CXXMethodDecl *MD = cast<CXXMethodDecl>(DRE->getDecl());
+ const CXXMethodDecl *MD =
+ cast<CXXMethodDecl>(DRE->getDecl())->getCanonicalDecl();
const llvm::Type *PtrDiffTy =
CGF.ConvertType(CGF.getContext().getPointerDiffType());