1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<typename T
, T Divisor
>
5 static const T value
= 10 / Divisor
; // expected-error{{in-class initializer is not a constant expression}}
8 int array1
[X
<int, 2>::value
== 5? 1 : -1];
9 X
<int, 0> xi0
; // expected-note{{in instantiation of template class 'X<int, 0>' requested here}}
14 static const T value
= 0; // expected-warning{{in-class initializer for static data member of type 'const float' is a C++0x extension}}
17 Y
<float> fy
; // expected-note{{in instantiation of template class 'Y<float>' requested here}}
20 // out-of-line static member variables
28 T Z
<T
>::value
; // expected-error{{no matching constructor}}
33 NoDefCon(const NoDefCon
&); // expected-note{{candidate constructor}}
37 DefCon
&DC
= Z
<DefCon
>::value
;
38 NoDefCon
&NDC
= Z
<NoDefCon
>::value
; // expected-note{{instantiation}}
43 ~X1(); // The errors won't be triggered without this dtor.
48 static char Helper(T
);
49 static const int value
= sizeof(Helper(T()));
63 static const int value
= sizeof(typeid(Helper()));
73 int y2
[Y2
<X2
>::value
];
82 ~Y3(); // The error isn't triggered without this dtor.
89 static const int value
= sizeof(T
);
93 Y3().Foo(X3
<SizeOf
<char>::value
>());
99 static const bool var
= false;
103 const bool X0
<T
>::var
;
106 struct X1
: public X0
<T
> {
107 static const bool var
= false;
111 const bool X1
<T
>::var
;
113 template class X0
<char>;
114 template class X1
<char>;