Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
llvm-svn: 83272
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 1dd97d6..82ec4fd0 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -298,7 +298,7 @@
llvm::Value *FuncPtr;
if (MD->isVirtual()) {
- uint64_t Index = CGF.CGM.GetVtableIndex(MD);
+ uint64_t Index = CGF.CGM.GetVtableIndex(MD->getCanonicalDecl());
FuncPtr = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
} else {