| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
// PR8905 |
| 5 |
template<char C1, char C2> |
| 6 |
struct X { |
| 7 |
static const bool value = 0; |
| 8 |
}; |
| 9 |
|
| 10 |
template<int C1> |
| 11 |
struct X<C1, C1> { |
| 12 |
static const bool value = 1; |
| 13 |
}; |
| 14 |
|
| 15 |
int check0[X<1, 2>::value == 0? 1 : -1]; |
| 16 |
int check1[X<1, 1>::value == 1? 1 : -1]; |
| 17 |
|
| 18 |
template<int, int, int> struct int_values { |
| 19 |
static const unsigned value = 0; |
| 20 |
}; |
| 21 |
|
| 22 |
template<unsigned char C1, unsigned char C3> |
| 23 |
struct int_values<C1, 12, C3> { |
| 24 |
static const unsigned value = 1; |
| 25 |
}; |
| 26 |
|
| 27 |
int check2[int_values<256, 12, 3>::value == 0? 1 : -1]; |