aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2002-07-24 19:49:21 +0000
committerBenjamin Kosnik <bkoz@redhat.com>2002-07-24 19:49:21 +0000
commit265954c3eadf8cd1a6bd8261941f8399b5c258ea (patch)
tree9d0a80e1bbe2cb5048fa2696df17b135786db5a6
parent543aa04695d4d57750564224052e1a57c25a13d9 (diff)
2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7286 * libsupc++/new: Add placement delete. * testsuite/18_support/new_delete_placement.cc: New. * docs/html/abi.txt: Fix typos. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@55718 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/docs/html/abi.txt18
-rw-r--r--libstdc++-v3/libsupc++/new4
-rw-r--r--libstdc++-v3/testsuite/18_support/new_delete_placement.cc40
4 files changed, 61 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a6fcda07ebb..801925ad42d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/7286
+ * libsupc++/new: Add placement delete.
+ * testsuite/18_support/new_delete_placement.cc: New.
+
+ * docs/html/abi.txt: Fix typos.
+
2002-07-23 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/documentation.html: Remove libstdc++-v3.0.86 links,
diff --git a/libstdc++-v3/docs/html/abi.txt b/libstdc++-v3/docs/html/abi.txt
index cbb0426e416..175e743ae60 100644
--- a/libstdc++-v3/docs/html/abi.txt
+++ b/libstdc++-v3/docs/html/abi.txt
@@ -139,15 +139,15 @@ one with a new compiler and an old library, and the other with an old
compiler and a new library, and look for testsuite regressions)
Two.
-Have the libstdc++ testesuite proactively check the library
-ABI. Probably a couple of items would be covered, although perhaps not
-all would need to be done at once for this to be useful. Compute the
-list of names exported in the shared version of libstdc++
-binary. Then, save this list of names. Have this list of names
-re-computed for each new binary of the same version. Next, use sizeof
-and offset to compute offsets for each structure and type in the
-standard library, saving to another datafile. Then, compute this for
-new binaries, and look for differences.
+Have the libstdc++ testsuite proactive check the library ABI. Probably
+a couple of items would be covered, although perhaps not all would
+need to be done at once for this to be useful. Compute the list of
+names exported in the shared version of libstdc++ binary. Then, save
+this list of names. Have this list of names re-computed for each new
+binary of the same version. Next, use sizeof, alignof, and offset to
+compute offsets for each structure and type in the standard library,
+saving to another datafile. Then, compute this for new binaries, and
+look for differences.
The thought is to choose one or both of these approaches, and to use a
Makefile hook, perhaps 'make check-abi', to add this capability to the
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index a47f4c68742..ad37c52789b 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -91,6 +91,10 @@ void operator delete[](void*, const std::nothrow_t&) throw();
// Default placement versions of operator new.
inline void* operator new(std::size_t, void* __p) throw() { return __p; }
inline void* operator new[](std::size_t, void* __p) throw() { return __p; }
+
+// Default placement versions of operator delete.
+inline void operator delete (void* ptr, void*) throw() { };
+inline void operator delete[](void* ptr, void*) throw() { };
//@}
} // extern "C++"
diff --git a/libstdc++-v3/testsuite/18_support/new_delete_placement.cc b/libstdc++-v3/testsuite/18_support/new_delete_placement.cc
new file mode 100644
index 00000000000..e65f19ca57f
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/new_delete_placement.cc
@@ -0,0 +1,40 @@
+// 2002-07-24 Benjamin Kosnik
+
+// Copyright (C) 2002 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 18.4.1.3 - Placement forms
+
+#include <new>
+#include <testsuite_hooks.h>
+
+// libstdc++/7286
+void test01()
+{
+ void* pc = new char;
+ void* pa = new char[10];
+ void* tmp;
+ operator delete(pc, tmp);
+ operator delete[](pa, tmp);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}