2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
|
2009-11-20 02:03:26 +08:00
|
|
|
|
|
|
|
template<int N>
|
|
|
|
void f() {
|
|
|
|
int a[] = { 1, 2, 3, N };
|
|
|
|
unsigned numAs = sizeof(a) / sizeof(int);
|
|
|
|
}
|
|
|
|
|
|
|
|
template void f<17>();
|
|
|
|
|
2009-11-20 07:25:22 +08:00
|
|
|
|
|
|
|
template<int N>
|
|
|
|
void f1() {
|
|
|
|
int a0[] = {}; // expected-warning{{zero}}
|
|
|
|
int a1[] = { 1, 2, 3, N };
|
|
|
|
int a3[sizeof(a1)/sizeof(int) != 4? 1 : -1]; // expected-error{{negative}}
|
|
|
|
}
|