blob: 5a744a0c384a34f87fd66383b92bebb18a41194c [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregor2943aed2009-03-03 04:44:36 +00002
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
Douglas Gregorb7a09262010-04-01 18:32:35 +000016Constant<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)'}}
Douglas Gregor2943aed2009-03-03 04:44:36 +000017
Douglas Gregor9148c3f2009-11-11 19:13:48 +000018Constant<float, 0> *c7; // expected-note{{while substituting}}