blob: 7914b677d21262eab782a6ace645b8cc20ee8c38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// { dg-do run }
// PRMS Id: 11596
#include <typeinfo>
extern "C" int printf (const char *, ...);
class Chicken
{
public:
int eggs_per_day;
};
template <class Bird>
class Flock
{
public:
Bird * flock_head;
int head_count;
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 (*flock_head).name ());
}
};
int main()
{
Flock<Chicken> x;
printf ("%s\n", typeid(x).name());
x.head_count = 42;
x.print_self();
}
|