PR c++/82039 suppress -Wzero-as-null-pointer-constant warning
authorJonathan Wakely <jwakely@redhat.com>
Thu, 31 Aug 2017 16:45:37 +0000 (17:45 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 31 Aug 2017 16:45:37 +0000 (17:45 +0100)
PR c++/82039
* include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate):
Adjust null pointer constant to avoid warning.

From-SVN: r251570

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/new_allocator.h

index cfc1ed359a1a8c9f0f5b6ceb26f19ef37b2608e4..ed1003a5fc49248c689ffd754a74e0bec6001ca0 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2017-08-24  François Dumont  <fdumont@gcc.gnu.org>
 
        * include/bits/stl_list.h
index ee64b9c6447156c9ebca54c4da54511c15284123..e1e152c4bf0cb71a6e797506d711dd506d232cab 100644 (file)
@@ -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();