From 445513b4bddd4a9dcf5483d025257074ee02db6e Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 14 Feb 2015 23:25:39 +0000 Subject: [PATCH] Pull in r201130 from upstream clang trunk (by Ted Kremenek): Fix PCH deserialization bug with local static symbols being treated as local extern. This triggered a miscompilation of code using Boost's function_template.hpp when it was included inside a PCH file. A local static within that header would be treated as local extern, resulting in the wrong mangling. This only occurred during PCH deserialization. Fixes and . This fixes a crash in audio/murmur, which is using both PCH and Boost. Direct commit to stable/10 and stable/9, since head has clang 3.5.1, which already includes this change. Reported by: smh PR: 197389 git-svn-id: svn://svn.freebsd.org/base/stable/10@278788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp index b8102d841..89f4547fe 100644 --- a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp @@ -971,7 +971,7 @@ ASTDeclReader::RedeclarableResult ASTDeclReader::VisitVarDeclImpl(VarDecl *VD) { VD->setCachedLinkage(VarLinkage); // Reconstruct the one piece of the IdentifierNamespace that we need. - if (VarLinkage != NoLinkage && + if (VD->getStorageClass() == SC_Extern && VarLinkage != NoLinkage && VD->getLexicalDeclContext()->isFunctionOrMethod()) VD->setLocalExternDecl(); -- 2.45.0