diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-06 19:04:27 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-06 19:04:27 +0000 |
commit | f84cde1cbc6a6e6c29f20b164af38dffab60366a (patch) | |
tree | 8fa67908f1b30f4427e6a09ac4ab131cb47d25e3 | |
parent | 32212f9d000e6bb631499afce43cd13fc0387413 (diff) |
Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113161 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 2 | ||||
-rw-r--r-- | test/PCH/cxx-templates.cpp | 2 | ||||
-rw-r--r-- | test/PCH/cxx-templates.h | 10 |
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) {} +}; |