summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-04 12:24:57 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-04 12:24:57 +0000
commit0a1b919ee760798832bd4de10cd7fc8c5bfd8ad3 (patch)
tree0dd0a41063f8b8f72a8906968a15f34ccd16918e
parenta578aa818aad45159a55c4e7c09a6c06de809f32 (diff)
downloadgcc-0a1b919ee760798832bd4de10cd7fc8c5bfd8ad3.tar.gz
PR c++/82039 suppress -Wzero-as-null-pointer-constant warning
Backport from mainline 2017-08-31 Jonathan Wakely <jwakely@redhat.com> PR c++/82039 * include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate): Adjust null pointer constant to avoid warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251658 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/ext/new_allocator.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8d5547f1b96..50433df68be 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,13 @@
2017-09-04 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
+ 2017-08-31 Jonathan Wakely <jwakely@redhat.com>
+
+ PR c++/82039
+ * include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate):
+ Adjust null pointer constant to avoid warning.
+
+ Backport from mainline
2017-08-21 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/81912
diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h
index ee64b9c6447..e1e152c4bf0 100644
--- a/libstdc++-v3/include/ext/new_allocator.h
+++ b/libstdc++-v3/include/ext/new_allocator.h
@@ -96,7 +96,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// NB: __n is permitted to be 0. The C++ standard says nothing
// about what the return value is when __n == 0.
pointer
- allocate(size_type __n, const void* = 0)
+ allocate(size_type __n, const void* = static_cast<const void*>(0))
{
if (__n > this->max_size())
std::__throw_bad_alloc();