summaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-03-23 19:45:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-03-23 19:45:26 +0000
commit9d5cd13e24d080ffb2d0af53cf06efbc1bdd5b2e (patch)
tree94c364e9ac1a37aaf629d98562e5aad80799b82d /lib/Serialization/ASTWriterDecl.cpp
parent6060bb2b9be28ec2ca2d0346b383d767e8a125ae (diff)
downloadclang-9d5cd13e24d080ffb2d0af53cf06efbc1bdd5b2e.tar.gz
clang-9d5cd13e24d080ffb2d0af53cf06efbc1bdd5b2e.tar.bz2
clang-9d5cd13e24d080ffb2d0af53cf06efbc1bdd5b2e.tar.xz
When we inject a declaration into a namespace, add the primary DeclContext to
the update set rather than the current DeclContext. Add test for the local extern case too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 3aeb89559e..4474328ec3 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -185,8 +185,9 @@ void ASTDeclWriter::VisitDecl(Decl *D) {
// function with a local extern declaration, for instance.
if (D->isOutOfLine()) {
auto *NS = dyn_cast<NamespaceDecl>(D->getDeclContext()->getRedeclContext());
+ // FIXME: Also update surrounding inline namespaces.
if (NS && NS->isFromASTFile())
- Writer.AddUpdatedDeclContext(NS);
+ Writer.AddUpdatedDeclContext(NS->getPrimaryContext());
}
}