summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-var-15.C
blob: 9782ccbd9a7c85cb9208c7c1395d946bfb9d19ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/45588
// { dg-do compile }
// { dg-options "-Wunused" }

void bar (unsigned char *);

template <int N>
struct S
{
  static const int k = 6;
};

template <int N>
const int S<N>::k;

template <int N>
void
foo ()
{
  const int i = S<N>::k;
  unsigned char a[i];
  bar (a);
}

void
baz ()
{
  foo<0> ();
}