diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/PCH/chain-cxx.cpp | 7 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/instantiate-declref-ice.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/clang/test/PCH/chain-cxx.cpp b/clang/test/PCH/chain-cxx.cpp index c42ee7d39ee..0d50e61c5a9 100644 --- a/clang/test/PCH/chain-cxx.cpp +++ b/clang/test/PCH/chain-cxx.cpp @@ -38,9 +38,12 @@ template<typename T> struct TestBaseSpecifiers2 : TestBaseSpecifiers<T> { }; 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 TestBaseSpecifiers4 : TestBaseSpecifiers3 { }; 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 @@ void test() { // Should have remembered that there is a definition. static const int ts3m2 = TS3<int>::value; +int arr[TS3<int>::value2]; //===----------------------------------------------------------------------===// #endif diff --git a/clang/test/SemaTemplate/instantiate-declref-ice.cpp b/clang/test/SemaTemplate/instantiate-declref-ice.cpp index 0f3c08b0562..49b1b63f515 100644 --- a/clang/test/SemaTemplate/instantiate-declref-ice.cpp +++ b/clang/test/SemaTemplate/instantiate-declref-ice.cpp @@ -31,4 +31,4 @@ struct X1 { template<typename T> const unsigned X1<T>::value = sizeof(T); -int array3[X1<int>::value == sizeof(int)? 1 : -1]; // expected-error{{variable length array declaration not allowed at file scope}} +int array3[X1<int>::value == sizeof(int)? 1 : -1]; |

