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