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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [sizeof2.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { 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 
6
 
7
extern "C" void abort();
8
 
9
template // Base class
10
class A { public: static int n() { return sizeof(T); } };
11
 
12
template // Derived #1
13
class B: public A {};
14
 
15
template // Derived #2 (wrong!)
16
class C: public A {};
17
 
18
int main() {
19
  if (C<1,2>::n() != 2)
20
    abort();
21
}

powered by: WebSVN 2.1.0

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