blob: 9d6b047f37722291292064c67c32a4110ca9012b [file] [log] [blame]
Douglas Gregor2943aed2009-03-03 04:44:36 +00001// RUN: clang -fsyntax-only -verify %s
2
3template<typename T, T Value> struct Constant; // expected-note{{template parameter is declared here}} \
4// FIXME: bad location expected-error{{a non-type template parameter cannot have type 'float'}}
5
6Constant<int, 5> *c1;
7
8int x;
9float f(int, double);
10
11Constant<int&, x> *c2;
12Constant<int*, &x> *c3;
13Constant<float (*)(int, double), f> *c4;
14Constant<float (*)(int, double), &f> *c5;
15
16Constant<float (*)(int, int), f> *c6; // expected-error{{non-type template argument of type 'float (*)(int, double)' cannot be converted to a value of type 'float (*)(int, int)'}}
17
Douglas Gregordf667e72009-03-10 20:44:00 +000018Constant<float, 0> *c7; // expected-note{{in instantiation of default argument for 'Constant<float>' required here}}