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++.jason/] [typeid2.C] - Blame information for rev 305

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// PRMS Id: 11596
3
 
4
#include 
5
extern "C" int printf (const char *, ...);
6
 
7
class Chicken
8
{
9
public:
10
  int eggs_per_day;
11
};
12
 
13
template 
14
class Flock
15
{
16
public:
17
  Bird * flock_head;
18
  int    head_count;
19
  void print_self() {
20
    printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
21
    printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
22
  }
23
};
24
 
25
int main()
26
{
27
  Flock x;
28
  printf ("%s\n", typeid(x).name());
29
  x.head_count = 42;
30
  x.print_self();
31
}

powered by: WebSVN 2.1.0

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