diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-09-04 17:41:38 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-09-04 17:41:38 +0100 |
commit | 62576f0b220e11d7192d789ec337f3732c83c636 (patch) | |
tree | fc2658b061d190767fd97b34df95f3493a4b13b8 | |
parent | 3495af3f697b552eed2f622ad18bf1a8447d6b09 (diff) | |
download | gcc-62576f0b220e11d7192d789ec337f3732c83c636.zip gcc-62576f0b220e11d7192d789ec337f3732c83c636.tar.gz gcc-62576f0b220e11d7192d789ec337f3732c83c636.tar.bz2 |
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.
From-SVN: r251672
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/new_allocator.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d876052..6ca4a21 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-18 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/81891 diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h index 83e3a0b..fcc5ff4 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<const void*>(0)) + { if (__n > this->max_size()) std::__throw_bad_alloc(); |