brintos

brintos / llvm-project-archived public Read only

0
0
Text · 506 B · 6fdcaa6 Raw
29 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s2 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 11 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}18 19namespace PR13788 {20  template <unsigned __N>21  struct S {22    int V;23  };24  template <int N>25  void foo() {26    S<0> arr[N] = {{ 4 }};27  }28}29