summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2014-02-11 06:29:29 +0000
committerTed Kremenek <kremenek@apple.com>2014-02-11 06:29:29 +0000
commita683f639c7e24408409c6d07979ba171e2581653 (patch)
tree17e70cbc6e752490dc486c8c975b855dc4b54ab6 /clang/lib
parentbf987c2dae19ff8bf4818292fb7f424c611592af (diff)
downloadbcm5719-llvm-a683f639c7e24408409c6d07979ba171e2581653.tar.gz
bcm5719-llvm-a683f639c7e24408409c6d07979ba171e2581653.zip
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 <rdar://problem/15975816> and <rdar://problem/15926311>. llvm-svn: 201130
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 943328b9cdc..18dbb053b99 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -973,7 +973,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();
OpenPOWER on IntegriCloud