diff options
author | Jakub Jelinek <jakub@redhat.com> | 2000-08-25 14:55:47 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2000-08-25 14:55:47 +0200 |
commit | 22efd68702b68b1f7577b1d96867ebb550dd1c5b (patch) | |
tree | b6eb8e48e763712d5221d4121372732b56986a2b | |
parent | 1f9124e42e485a2afe439fbd6966a5263783186c (diff) | |
download | gcc-22efd68702b68b1f7577b1d96867ebb550dd1c5b.zip gcc-22efd68702b68b1f7577b1d96867ebb550dd1c5b.tar.gz gcc-22efd68702b68b1f7577b1d96867ebb550dd1c5b.tar.bz2 |
* testsuite/g++.old-deja/g++.other/crash22.C: New test.
From-SVN: r35983
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash22.C | 56 |
2 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ce3b7f..99afdaf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..89f35f3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash22.C @@ -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; +} |