From d8bb3aff76145e391a0df4be7591021d083bc258 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 6 May 2010 23:13:35 +0000 Subject: Do not give implicitly-defined virtual members functions available_externally linkage, since they may not have been given a strong definition in another translation unit. Without this patch, the following test case fails to link with a GCC-compiled libstdc++: #include int main() { std::basic_stringbuf bs; } Fixes the last problem with the Boost.IO library. llvm-svn: 103208 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9c84bcec054..6cbc3f67c2d 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -322,8 +322,8 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD, // only for inlining and analysis. This is the semantics of c99 inline. if (const CXXMethodDecl *MD = dyn_cast(FD)) { const CXXRecordDecl *RD = MD->getParent(); - if (MD->isVirtual() && - CodeGenVTables::isKeyFunctionInAnotherTU(Context, RD)) + if (MD->isVirtual() && !MD->isImplicit() && + CodeGenVTables::isKeyFunctionInAnotherTU(Context, RD)) return CodeGenModule::GVA_C99Inline; } -- cgit v1.2.3