Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Douglas Gregor | 2943aed | 2009-03-03 04:44:36 +0000 | [diff] [blame] | 2 | |
| 3 | template<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 | |
| 6 | Constant<int, 5> *c1; |
| 7 | |
| 8 | int x; |
| 9 | float f(int, double); |
| 10 | |
| 11 | Constant<int&, x> *c2; |
| 12 | Constant<int*, &x> *c3; |
| 13 | Constant<float (*)(int, double), f> *c4; |
| 14 | Constant<float (*)(int, double), &f> *c5; |
| 15 | |
| 16 | Constant<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 Gregor | 9148c3f | 2009-11-11 19:13:48 +0000 | [diff] [blame] | 18 | Constant<float, 0> *c7; // expected-note{{while substituting}} |