]> granicus.if.org Git - clang/commitdiff
Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Sep 2010 19:04:27 +0000 (19:04 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Sep 2010 19:04:27 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113161 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp
test/PCH/cxx-templates.cpp
test/PCH/cxx-templates.h

index f07215cb8f512fcc82fc110a861497da32f61bf1..388ae8a98fa11fa73446a9181c62ae703e9bd9aa 100644 (file)
@@ -3872,6 +3872,8 @@ ASTReader::ReadCXXBaseOrMemberInitializers(llvm::BitstreamCursor &Cursor,
                                                      Indices.size());
       }
 
+      if (IsWritten)
+        BOMInit->setSourceOrder(SourceOrderOrNumArrayIndices);
       BOMInit->setAnonUnionMember(AnonUnionMember);
       BaseOrMemberInitializers[i] = BOMInit;
     }
index a862ea579e35a8fe9edd624101fa7e4fd0583fa9..d36d5449c81c2cbdce37dac84f991b9e9dfceed0 100644 (file)
@@ -30,6 +30,8 @@ void test() {
   
   S3<int> s3;
   s3.m();
+
+  TS5 ts(0);
 }
 
 template struct S4<int>;
index 978d768acc9207c68af2eefe62beef30659700c6..e5c06a9e12aa0a5cdcd2fcbab70cdf9f5f11549b 100644 (file)
@@ -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) {}
+};