OSDN Git Service

Addition of a whole slew of "eb" test cases generated from the egcs-bugs
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.robertl / 980310-3.C
1 // Bug: Segfaults on egcs 1.0.1 i586-pc-linux-glibc1
2 // From: Max Lawson <mlawson@drfmc.ceng.cea.fr>
3 // Message-Id: <9803091022.AA07520@drfmc.ceng.cea.fr>
4
5 class S0
6 {
7 public:
8
9   S0() { };
10
11   virtual ~S0() { }
12 };
13
14
15
16 struct S { };
17 class S1 : public S, public S0
18
19 public:
20
21   S1() { }
22 };
23
24
25 void test_ptr(void *ctxt)
26 {
27   S0 *ctxt1 = static_cast<S0*>(ctxt);
28
29   S1* ctxt2 = dynamic_cast<S1*>(ctxt1);
30 }
31
32
33 int main()
34 {
35   S1 *ctxt = new S1();
36
37   test_ptr(ctxt);
38
39   return 0;
40 }
41
42