Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / eh / ctor2.C
blobe2ebad7ce535d20b6ed11632184fb642a9586138
1 // PR c++/4460
2 // Test that the cleanup for fully-constructed subobjects when a
3 // constructor throws gets the right address for a virtual base.
5 // { dg-do run }
7 int r;
8 void *p;
10 struct VBase
12   virtual void f () {}
13   VBase() { p = this; }
14   ~VBase() { if (p != this) r = 1; }
17 struct  StreamBase 
19   virtual ~StreamBase() {}
22 struct  Stream : public virtual VBase, public StreamBase
24   Stream() {}
25   virtual ~Stream() {} 
28 struct DerivedStream : public Stream
30   DerivedStream() { throw 1; }
33 int main() {
35   try
36     { 
37       DerivedStream str;
38     }
39   catch (...) { }
41   return r;