[cfe-commits] r113161 - in /cfe/trunk: lib/Serialization/ASTReader.cpp test/PCH/cxx-templates.cpp test/PCH/cxx-templates.h
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Sep 6 12:04:27 PDT 2010
Author: akirtzidis
Date: Mon Sep 6 14:04:27 2010
New Revision: 113161
URL: http://llvm.org/viewvc/llvm-project?rev=113161&view=rev
Log:
Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set.
Modified:
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/test/PCH/cxx-templates.cpp
cfe/trunk/test/PCH/cxx-templates.h
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=113161&r1=113160&r2=113161&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Sep 6 14:04:27 2010
@@ -3872,6 +3872,8 @@
Indices.size());
}
+ if (IsWritten)
+ BOMInit->setSourceOrder(SourceOrderOrNumArrayIndices);
BOMInit->setAnonUnionMember(AnonUnionMember);
BaseOrMemberInitializers[i] = BOMInit;
}
Modified: cfe/trunk/test/PCH/cxx-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-templates.cpp?rev=113161&r1=113160&r2=113161&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-templates.cpp (original)
+++ cfe/trunk/test/PCH/cxx-templates.cpp Mon Sep 6 14:04:27 2010
@@ -30,6 +30,8 @@
S3<int> s3;
s3.m();
+
+ TS5 ts(0);
}
template struct S4<int>;
Modified: cfe/trunk/test/PCH/cxx-templates.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-templates.h?rev=113161&r1=113160&r2=113161&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-templates.h (original)
+++ cfe/trunk/test/PCH/cxx-templates.h Mon Sep 6 14:04:27 2010
@@ -135,3 +135,13 @@
S4<int> s;
s.m();
}
+
+struct S5 {
+ S5(int x);
+};
+
+struct TS5 {
+ S5 s;
+ template <typename T>
+ TS5(T y) : s(y) {}
+};
More information about the cfe-commits
mailing list