OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [sizeof2.C] - Rev 305

Compare with Previous | Blame | View Log

// { dg-do run  }
// Although template class B is not used at all, it causes the
// incorrect specialization of A to be selected

// Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>

extern "C" void abort();

template<int N, class T> // Base class
class A { public: static int n() { return sizeof(T); } };

template<int N> // Derived #1
class B: public A<N,char[N]> {};

template<int N, int M> // Derived #2 (wrong!)
class C: public A<N,char[M]> {};

int main() {
  if (C<1,2>::n() != 2)
    abort();
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.