OSDN Git Service

gcc/cp/
authorsimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Jun 2008 00:19:25 +0000 (00:19 +0000)
committersimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Jun 2008 00:19:25 +0000 (00:19 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136774 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 897a54e..77f1c0c 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 4d786a2..12b17f3 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 6ddf1ce..507416c 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*, ...);
+};