summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/dependent-name3.C
blob: bbe6fb66266e8062571845d8f21703b7497fb763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile }

// Dependent arrays of invalid size generate appropriate error messages

template<int I> struct A
{
  static const int zero = 0;
  static const int minus_one = -1;
};

template<int N> struct B
{
  int x[A<N>::zero];       // { dg-error "zero" }
  int y[A<N>::minus_one];  // { dg-error "negative" }
};

B<0> b;