Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115667 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index a68f562..e42a5b4 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -658,6 +658,7 @@
void ASTDeclReader::VisitNamespaceDecl(NamespaceDecl *D) {
VisitNamedDecl(D);
+ D->IsInline = Record[Idx++];
D->setLBracLoc(ReadSourceLocation(Record, Idx));
D->setRBracLoc(ReadSourceLocation(Record, Idx));
D->setNextNamespace(
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index f8d584b..07520d8 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -610,6 +610,7 @@
void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) {
VisitNamedDecl(D);
+ Record.push_back(D->isInline());
Writer.AddSourceLocation(D->getLBracLoc(), Record);
Writer.AddSourceLocation(D->getRBracLoc(), Record);
Writer.AddDeclRef(D->getNextNamespace(), Record);
diff --git a/test/PCH/Inputs/namespaces.h b/test/PCH/Inputs/namespaces.h
index 553aadd..bd2c3ee 100644
--- a/test/PCH/Inputs/namespaces.h
+++ b/test/PCH/Inputs/namespaces.h
@@ -38,3 +38,7 @@
extern "C" {
void ext();
}
+
+inline namespace N4 {
+ struct MemberOfN4;
+}
diff --git a/test/PCH/namespaces.cpp b/test/PCH/namespaces.cpp
index b8a22e5..6dd4473 100644
--- a/test/PCH/namespaces.cpp
+++ b/test/PCH/namespaces.cpp
@@ -40,3 +40,6 @@
using N1::used_cls;
used_cls s1;
used_cls* ps1 = &s1;
+
+inline namespace N4 { }
+struct MemberOfN4 *mn4;