C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/PCH/chain-cxx.cpp b/test/PCH/chain-cxx.cpp
index c42ee7d..0d50e61 100644
--- a/test/PCH/chain-cxx.cpp
+++ b/test/PCH/chain-cxx.cpp
@@ -38,9 +38,12 @@
 template <typename T>
 struct TS3 {
   static const int value = 0;
+  static const int value2;
 };
 template <typename T>
 const int TS3<T>::value;
+template <typename T>
+const int TS3<T>::value2 = 1;
 // Instantiate struct, but not value.
 struct instantiate : TS3<int> {};
 
@@ -96,8 +99,9 @@
 struct A { };
 struct B : A { };
 
-// Instantiate TS3's member.
+// Instantiate TS3's members.
 static const int ts3m1 = TS3<int>::value;
+extern int arr[TS3<int>::value2];
 
 // Redefinition of typedef
 typedef int Integer;
@@ -132,6 +136,7 @@
 
 // Should have remembered that there is a definition.
 static const int ts3m2 = TS3<int>::value;
+int arr[TS3<int>::value2];
 
 //===----------------------------------------------------------------------===//
 #endif