blob: cf0e0f37ee047692419fa3e695d1caa5fbff0acd [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
Douglas Gregorcb78d882009-11-19 18:03:26 +00002
3template<int N>
4void f() {
5 int a[] = { 1, 2, 3, N };
6 unsigned numAs = sizeof(a) / sizeof(int);
7}
8
9template void f<17>();
10
Douglas Gregor73460a32009-11-19 23:25:22 +000011
12template<int N>
13void f1() {
14 int a0[] = {}; // expected-warning{{zero}}
15 int a1[] = { 1, 2, 3, N };
16 int a3[sizeof(a1)/sizeof(int) != 4? 1 : -1]; // expected-error{{negative}}
17}