* c-common.c (get_priority): Add check for
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / sizeof2.C
blob97127ea0f0dbd7194e9d9cdfa1c8d46bc093560b
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
5 // Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>
7 extern "C" void abort();
9 template<int N, class T> // Base class
10 class A { public: static int n() { return sizeof(T); } };
12 template<int N> // Derived #1
13 class B: public A<N,char[N]> {};
15 template<int N, int M> // Derived #2 (wrong!)
16 class C: public A<N,char[M]> {};
18 int main() {
19   if (C<1,2>::n() != 2)
20     abort();