]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/82039 suppress -Wzero-as-null-pointer-constant warning
authorJonathan Wakely <jwakely@redhat.com>
Mon, 4 Sep 2017 16:41:38 +0000 (17:41 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 4 Sep 2017 16:41:38 +0000 (17:41 +0100)
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.

From-SVN: r251672

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

index d876052b2a8693671b125421903a63ee4b46dea0..6ca4a210ede24ddae7f6caf8e0bb7b5e2fde4fc0 100644 (file)
@@ -1,5 +1,12 @@
 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-18  Jonathan Wakely  <jwakely@redhat.com>
 
index 83e3a0b0a8f8e628f490efebae2d16f881934930..fcc5ff4dae3039b224e536b67ed33fffa3fbeb6c 100644 (file)
@@ -96,8 +96,8 @@ _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();