Commit 355298fb by Alexandre Oliva Committed by Alexandre Oliva

* thunk1.C: New test.

From-SVN: r28858
parent f4c6443e
1999-08-25 Alexandre Oliva <oliva@dcc.unicamp.br>
* thunk1.C: New test.
1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
* dwarf2.C, dwarf3.C: Added XFAIL for Solaris/x86. Removed
......
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@dcc.unicamp.br>
// based on bug report by Fredrik Öhrström <d92-foh@nada.kth.se>
// Special g++ Options: -fvtable-thunks
// execution test - XFAIL *-*-*
#include <cstdlib>
using namespace std;
struct vbase {
virtual int get_a() const = 0;
};
struct base: virtual vbase {
int a;
base(int aa) : a(aa) {}
int get_a() const { return a; }
};
struct mid: base {
mid(int bb) : base(bb) {
// when mid is not in charge of vbase initialization,
// a derived-aware vtable is needed for vbase
if (((vbase*)this)->get_a() != bb)
abort();
}
};
struct derived: virtual mid {
derived(int cc) : mid(cc) {}
};
int main () {
derived(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment