diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-23 18:56:16 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-23 18:56:16 +0000 |
commit | 5fb12c6c8f64d4b69f65faefb7d0800d7e4bca66 (patch) | |
tree | d83e15531a5c7e44cebe5a1303a9d1110e3ecf42 /lib/CodeGen/CGVtable.cpp | |
parent | 707ea283f5514e2cb633a89f702190f0d798c7ea (diff) |
Avoid producing implicit methods when we have a explicit template instantiation
declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 9204e4e565..cedefba1e4 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -3805,7 +3805,17 @@ void CodeGenVTables::EmitVTableRelatedData(GlobalDecl GD) { return; TemplateSpecializationKind kind = RD->getTemplateSpecializationKind(); - if (kind == TSK_ImplicitInstantiation) + + + // The reason we have TSK_ExplicitInstantiationDeclaration in here (but not + // in Sema::MaybeMarkVirtualMembersReferenced) is for the case + // template<> void stdio_sync_filebuf<wchar_t>::xsgetn() { + // } + // extern template class stdio_sync_filebuf<wchar_t>; + // Since we are called after the extern declaration is seen. + + if (kind == TSK_ImplicitInstantiation || + kind == TSK_ExplicitInstantiationDeclaration) CGM.DeferredVtables.push_back(RD); else GenerateClassData(CGM.getVtableLinkage(RD), RD); |