From: Argyrios Kyrtzidis Date: Mon, 6 Sep 2010 19:04:27 +0000 (+0000) Subject: Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f84cde1cbc6a6e6c29f20b164af38dffab60366a;p=clang 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 --- 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 s3; s3.m(); + + TS5 ts(0); } template struct S4; 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 s; s.m(); } + +struct S5 { + S5(int x); +}; + +struct TS5 { + S5 s; + template + TS5(T y) : s(y) {} +};