summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/vbase2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vbase2.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase2.C b/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
new file mode 100644
index 000000000..812b54764
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vbase2.C
@@ -0,0 +1,37 @@
+// { dg-do run }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int i;
+
+struct A
+{
+ ~A ();
+};
+
+A::~A () {
+ i = 1;
+}
+
+struct B : virtual public A {
+};
+
+struct C {
+ C ();
+
+ B b;
+};
+
+C::C () {
+ throw 3;
+}
+
+int main ()
+{
+ try {
+ C c;
+ } catch (...) {
+ }
+
+ if (i != 1)
+ return 1;
+}