summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net21.C
blob: dab95a6fc2c79bdaaf04737b68eb93fde1a3751e (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// { dg-do run  }
// Make sure we can initialize complex (MI ambiguous) vtables.

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

struct a
{
    virtual void f() = 0;
};

struct b
{
    virtual void g() { }
};

struct c: public a, public b
{
    virtual void f();
    virtual void g();
};

void c::f()
{
    printf("c::f()\n");
}

void c::g()
{
    printf("c::g()\n");
}

struct e: public b
{
};

struct h
{
};

struct d: public c, public e, public h
{
    virtual void f();
    virtual void g();
};
void d::f()
{
    printf("d::f()\n");
}

void d::g()
{
    printf("d::g()\n");
}

int main(int argc, char* argv[])
{
    a* tmp = new d;
    tmp->f();
    return 0;
}