1// { dg-do run  }
2// Although template class B is not used at all, it causes the
3// incorrect specialization of A to be selected
4
5// Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>
6
7extern "C" void abort();
8
9template<int N, class T> // Base class
10class A { public: static int n() { return sizeof(T); } };
11
12template<int N> // Derived #1
13class B: public A<N,char[N]> {};
14
15template<int N, int M> // Derived #2 (wrong!)
16class C: public A<N,char[M]> {};
17
18int main() {
19  if (C<1,2>::n() != 2)
20    abort();
21}
22