summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p3570.C
blob: e8502d5358e170b294e600ec47548b60a1e1b3c5 (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
// { dg-do run  }
// prms-id: 3570

extern "C" int printf(const char *, ...);

struct A {
   void print() {printf("A");}
};

struct B :  A {
   typedef A superB;
   void print() {superB::print(); printf("B");}
};

struct C :  B {
   typedef B superC;
   void print() {superC::print(); printf("C");}
};

int main ()
{
   A a;
   B b;
   C c;

   a.print(); printf("\n");
   b.print(); printf("\n");
   c.print(); printf("\n");
   return 0;
}