diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 195acc5bc15..1fbd3b92735 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -623,7 +623,9 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { const CGRecordLayout &CGLayout = Types.getCGRecordLayout(RD); // A definition of a KeyFunction, generates all the class data, such // as vtable, rtti and the VTT. - if (CGLayout.getKeyFunction() == MD) + if (CGLayout.getKeyFunction() + && (CGLayout.getKeyFunction()->getCanonicalDecl() + == MD->getCanonicalDecl())) getVtableInfo().GenerateClassData(RD); } if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D)) |