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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [typeid2.C] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// PRMS Id: 11596
// PRMS Id: 11596
#include 
#include 
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
class Chicken
class Chicken
{
{
public:
public:
  int eggs_per_day;
  int eggs_per_day;
};
};
template 
template 
class Flock
class Flock
{
{
public:
public:
  Bird * flock_head;
  Bird * flock_head;
  int    head_count;
  int    head_count;
  void print_self() {
  void print_self() {
    printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
    printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
    printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
    printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
  }
  }
};
};
int main()
int main()
{
{
  Flock x;
  Flock x;
  printf ("%s\n", typeid(x).name());
  printf ("%s\n", typeid(x).name());
  x.head_count = 42;
  x.head_count = 42;
  x.print_self();
  x.print_self();
}
}
 
 

powered by: WebSVN 2.1.0

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