aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig28.C
blob: 4edff680ce854d7f006440aa6d35655ffa08edfc (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Special g++ Options: -fhandle-signatures
// GROUPS passed gb sigptr multiple-inheritance
// Test correct adjustment of `this' pointer in case of multiple inheritance.

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

class C
{
  char * text;
public:
  C () { text = "PA"; }
  char * f (void) { return text; }
};

class D
{
  char * text;
public:
  D () { text = "SS"; }
  char * g (void) { return text; }
};

class E : public C, public D
{
public:
  E () : C (), D () { }
};

signature S
{
  char * f (void);
  char * g (void);
};

int main (void)
{
  E a;
  S * p = &a;

  printf ("%s%s\n", p->f (), p->g ());

  return 0;
}