gcc/testsuite/g++.dg/template/dependent-name3.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Dependent arrays of invalid size generate appropriate error messages |
| 4 | |
| 5 | template<int I> struct A |
| 6 | { |
| 7 | static const int zero = 0; |
| 8 | static const int minus_one = -1; |
| 9 | }; |
| 10 | |
| 11 | template<int N> struct B |
| 12 | { |
| 13 | int x[A<N>::zero]; // { dg-error "zero" } |
| 14 | int y[A<N>::minus_one]; // { dg-error "size .-1. of array is negative|narrowing conversion|not an integral constant-expression" } |
| 15 | }; |
| 16 | |
| 17 | B<0> b; |