diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2008-06-14 00:19:25 +0000 |
---|---|---|
committer | Simon Martin <simartin@gcc.gnu.org> | 2008-06-14 00:19:25 +0000 |
commit | 4b8cb94c75369959bf369c9129c03a0976cec984 (patch) | |
tree | 3432f4983a8f2987d5206954ad0d803c38dfa267 | |
parent | df2fa09712214e5be2468ef876e9964569240c71 (diff) | |
download | gcc-4b8cb94c75369959bf369c9129c03a0976cec984.zip gcc-4b8cb94c75369959bf369c9129c03a0976cec984.tar.gz gcc-4b8cb94c75369959bf369c9129c03a0976cec984.tar.bz2 |
re PR c++/35317 (ICE with operator delete[] and ellipsis)
gcc/cp/
2008-06-14 Simon Martin <simartin@users.sourceforge.net>
PR c++/35317
* class.c (type_requires_array_cookie): Do not consider delete[]
operators with an ellipsis as second argument.
gcc/testsuite/
2008-06-14 Simon Martin <simartin@users.sourceforge.net>
PR c++/35317
* g++.dg/other/dtor2.C: New test.
From-SVN: r136774
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/dtor2.C | 7 |
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 897a54e..77f1c0c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-06-14 Simon Martin <simartin@users.sourceforge.net> + + PR c++/35317 + * class.c (type_requires_array_cookie): Do not consider delete[] + operators with an ellipsis as second argument. + 2008-06-09 Jakub Jelinek <jakub@redhat.com> PR c++/36408 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 4d786a2..12b17f3 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4127,6 +4127,10 @@ type_requires_array_cookie (tree type) second_parm = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (fn))); if (second_parm == void_list_node) return false; + /* Do not consider this function if its second argument is an + ellipsis. */ + if (!second_parm) + continue; /* Otherwise, if we have a two-argument function and the second argument is `size_t', it will be the usual deallocation function -- unless there is one-argument function, too. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ddf1ce..507416c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-06-14 Simon Martin <simartin@users.sourceforge.net> + + PR c++/35317 + * g++.dg/other/dtor2.C: New test. + 2008-06-13 Olivier Hainque <hainque@adacore.com> * gnat.dg/task_stack_align.adb: New test. diff --git a/gcc/testsuite/g++.dg/other/dtor2.C b/gcc/testsuite/g++.dg/other/dtor2.C new file mode 100644 index 0000000..4593391 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/dtor2.C @@ -0,0 +1,7 @@ +/* PR c++/35317 */ +/* { dg-do "compile" } */ + +struct A +{ + void operator delete[] (void*, ...); +}; |