| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
template<typename T, int... Dims> |
| 3 |
struct array { |
| 4 |
static const int value = 0; |
| 5 |
}; |
| 6 |
|
| 7 |
template<> |
| 8 |
struct array<int, 17> { |
| 9 |
static const int value = 1; |
| 10 |
}; |
| 11 |
|
| 12 |
template<int... Dims> |
| 13 |
struct array<float, 1, Dims...> { |
| 14 |
static const int value = 2; |
| 15 |
}; |
| 16 |
|
| 17 |
template<typename T, int... Dims> |
| 18 |
struct array<T, 1, Dims...> { |
| 19 |
static const int value = 3; |
| 20 |
}; |
| 21 |
|
| 22 |
int a0[array<int>::value == 0? 1 : -1]; |
| 23 |
int a1[array<int, 17>::value == 1? 1 : -1]; |
| 24 |
int a2[array<float, 1, 2, 3>::value == 2? 1 : -1]; |
| 25 |
int a3[array<double, 1, 2, 3>::value == 3? 1 : -1]; |