From: Jonathan Wakely Date: Mon, 4 Sep 2017 16:41:38 +0000 (+0100) Subject: PR c++/82039 suppress -Wzero-as-null-pointer-constant warning X-Git-Tag: releases/gcc-5.5.0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62576f0b220e11d7192d789ec337f3732c83c636;p=thirdparty%2Fgcc.git PR c++/82039 suppress -Wzero-as-null-pointer-constant warning Backport from mainline 2017-08-31 Jonathan Wakely PR c++/82039 * include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate): Adjust null pointer constant to avoid warning. From-SVN: r251672 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d876052b2a86..6ca4a210ede2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2017-09-04 Jonathan Wakely + Backport from mainline + 2017-08-31 Jonathan Wakely + + 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 diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h index 83e3a0b0a8f8..fcc5ff4dae30 100644 --- a/libstdc++-v3/include/ext/new_allocator.h +++ b/libstdc++-v3/include/ext/new_allocator.h @@ -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(0)) + { if (__n > this->max_size()) std::__throw_bad_alloc();