| // RUN: %clang_cc1 -fsyntax-only -verify %s |
| template<typename T, T Divisor> |
| static const T value = 10 / Divisor; // expected-error{{in-class initializer is not an integral constant expression}} |
| int array1[X<int, 2>::value == 5? 1 : -1]; |
| X<int, 0> xi0; // expected-note{{in instantiation of template class 'class X<int, 0>' requested here}} |
| static const T value = 0; // expected-error{{'value' can only be initialized if it is a static const integral data member}} |
| Y<float> fy; // expected-note{{in instantiation of template class 'class Y<float>' requested here}} |
| // out-of-line static member variables |
| T Z<T>::value; // expected-error{{no matching constructor}} |
| NoDefCon(const NoDefCon&); |
| DefCon &DC = Z<DefCon>::value; |
| NoDefCon &NDC = Z<NoDefCon>::value; // expected-note{{instantiation}} |
| ~X1(); // The errors won't be triggered without this dtor. |
| static const int value = sizeof(Helper(T())); |
| static const int value = sizeof(typeid(Helper())); |
| ~Y3(); // The error isn't triggered without this dtor. |
| static const int value = sizeof(T); |
| Y3().Foo(X3<SizeOf<char>::value>()); |