re PR c++/35317 (ICE with operator delete[] and ellipsis)
authorSimon Martin <simartin@users.sourceforge.net>
Sat, 14 Jun 2008 00:19:25 +0000 (00:19 +0000)
committerSimon Martin <simartin@gcc.gnu.org>
Sat, 14 Jun 2008 00:19:25 +0000 (00:19 +0000)
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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/dtor2.C [new file with mode: 0644]

index 897a54edb4e3cb216d458e4a139fe5ac05160e67..77f1c0c1583bc246c4dff7bb18e8ac8e31c125f5 100644 (file)
@@ -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
index 4d786a288c12da68d06f0f1b09e46b91d2c02a31..12b17f3751c639789b2d5a3b9e87bd882578fc26 100644 (file)
@@ -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.  */
index 6ddf1ce49d20abb0791996077c1dddc7bc209689..507416c040e064f996da96c02da595b019e74c95 100644 (file)
@@ -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 (file)
index 0000000..4593391
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR c++/35317 */
+/* { dg-do "compile" } */
+
+struct A
+{
+  void operator delete[] (void*, ...);
+};