This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
v3 PATCH to avoid -Wsized-deallocation warnings with C++14 compiler
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 21 May 2015 11:11:18 -0400
- Subject: v3 PATCH to avoid -Wsized-deallocation warnings with C++14 compiler
- Authentication-results: sourceware.org; auth=none
When GCC defaults to C++14, it gives -Wsized-deallocation warnings for
the non-sized operator deletes. We dealt with this for the sized ones
by passing -Wno-sized-deallocation on the command line, but using
#pragma GCC diagnostic seems cleaner to me.
Applying to trunk.
commit 35cc1a3b6855a3e2e798d389674c98b6d5c24ffa
Author: Jason Merrill <jason@redhat.com>
Date: Wed May 20 14:21:48 2015 -0400
* libsupc++/del_opv.cc: Suppress -Wsized-deallocation.
* libsupc++/del_op.cc: Likewise.
diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc
index 06eb2a0..8e7aa2f 100644
--- a/libstdc++-v3/libsupc++/del_op.cc
+++ b/libstdc++-v3/libsupc++/del_op.cc
@@ -40,6 +40,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
#include "new"
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
_GLIBCXX_WEAK_DEFINITION void
operator delete(void* ptr) _GLIBCXX_USE_NOEXCEPT
{
diff --git a/libstdc++-v3/libsupc++/del_opv.cc b/libstdc++-v3/libsupc++/del_opv.cc
index 6fc1710..0a050bb 100644
--- a/libstdc++-v3/libsupc++/del_opv.cc
+++ b/libstdc++-v3/libsupc++/del_opv.cc
@@ -26,6 +26,9 @@
#include <bits/c++config.h>
#include "new"
+// The sized deletes are defined in other files.
+#pragma GCC diagnostic ignored "-Wsized-deallocation"
+
_GLIBCXX_WEAK_DEFINITION void
operator delete[] (void *ptr) _GLIBCXX_USE_NOEXCEPT
{