From 9d5cd13e24d080ffb2d0af53cf06efbc1bdd5b2e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 23 Mar 2014 19:45:26 +0000 Subject: 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 --- lib/Serialization/ASTWriterDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Serialization/ASTWriterDecl.cpp') 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(D->getDeclContext()->getRedeclContext()); + // FIXME: Also update surrounding inline namespaces. if (NS && NS->isFromASTFile()) - Writer.AddUpdatedDeclContext(NS); + Writer.AddUpdatedDeclContext(NS->getPrimaryContext()); } } -- cgit v1.2.3