aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Serialization/ASTReader.cpp2
-rw-r--r--test/PCH/cxx-templates.cpp2
-rw-r--r--test/PCH/cxx-templates.h10
3 files changed, 14 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index f07215cb8f..388ae8a98f 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -3872,6 +3872,8 @@ ASTReader::ReadCXXBaseOrMemberInitializers(llvm::BitstreamCursor &Cursor,
Indices.size());
}
+ if (IsWritten)
+ BOMInit->setSourceOrder(SourceOrderOrNumArrayIndices);
BOMInit->setAnonUnionMember(AnonUnionMember);
BaseOrMemberInitializers[i] = BOMInit;
}
diff --git a/test/PCH/cxx-templates.cpp b/test/PCH/cxx-templates.cpp
index a862ea579e..d36d5449c8 100644
--- a/test/PCH/cxx-templates.cpp
+++ b/test/PCH/cxx-templates.cpp
@@ -30,6 +30,8 @@ void test() {
S3<int> s3;
s3.m();
+
+ TS5 ts(0);
}
template struct S4<int>;
diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h
index 978d768acc..e5c06a9e12 100644
--- a/test/PCH/cxx-templates.h
+++ b/test/PCH/cxx-templates.h
@@ -135,3 +135,13 @@ void S4ImplicitInst() {
S4<int> s;
s.m();
}
+
+struct S5 {
+ S5(int x);
+};
+
+struct TS5 {
+ S5 s;
+ template <typename T>
+ TS5(T y) : s(y) {}
+};