1 // PR c++/45588 2 // { dg-do compile } 3 // { dg-options "-Wunused" } 4 5 void bar (unsigned char *); 6 7 template <int N> 8 struct S 9 { 10 static const int k = 6; 11 }; 12 13 template <int N> 14 const int S<N>::k; 15 16 template <int N> 17 void foo()18foo () 19 { 20 const int i = S<N>::k; 21 unsigned char a[i]; 22 bar (a); 23 } 24 25 void baz()26baz () 27 { 28 foo<0> (); 29 } 30