* testsuite/g++.old-deja/g++.other/crash22.C: New test.
authorJakub Jelinek <jakub@redhat.com>
Fri, 25 Aug 2000 12:55:47 +0000 (14:55 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 25 Aug 2000 12:55:47 +0000 (14:55 +0200)
From-SVN: r35983

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/crash22.C [new file with mode: 0644]

index 0ce3b7fcefea74b9d7234e7b5889017719d0a2d5..99afdaf7eaa7299aa11484019886a02b7d70cf0c 100644 (file)
@@ -1,3 +1,7 @@
+2000-08-25  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/g++.old-deja/g++.other/crash22.C: New test.
+
 2000-08-24  Mark Mitchell  <mark@codesourcery.com>
 
        * gcc.dg/noncompile/930622-2.c: Adjust error message.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash22.C b/gcc/testsuite/g++.old-deja/g++.other/crash22.C
new file mode 100644 (file)
index 0000000..89f35f3
--- /dev/null
@@ -0,0 +1,56 @@
+// Build don't run:
+// Special g++ Options: -O2
+
+class foo
+{
+};
+
+typedef void *voidp;
+class vect : public foo
+{
+public:
+  voidp& a();
+  int b();
+};
+
+class bar
+{
+public:
+  bar *c(bool (*f)(bar *node), voidp g)
+    {
+      int i=0;
+      bool j;
+      while (i < d.b()){
+        j = (f == __null) || f((bar*)d.a());
+        if (j)
+          ((bar*)d.a())->c(f, g);
+        i++;
+      }
+      return this;
+    }
+ public:
+  vect d;
+  bar *e(foo *k);
+};
+
+bar *bar::e(foo *k)
+{
+  return c(__null, k);
+}
+
+voidp &vect::a()
+{
+  static voidp x;
+  return x;
+}
+
+int vect::b()
+{
+  static int x;
+  return x;
+}
+
+int main()
+{
+  return 0;
+}