aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2017-08-31 17:45:37 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2017-08-31 17:45:37 +0100
commit89c6ecfa4c1aabd60edb7f5c31556444ddcd3d7f (patch)
treedb0cd2d48d6ed317bfdf17f635167bb90d176594
parent3ec5b5f015903512558b480752056ac9e41e8f3d (diff)
downloadgcc-89c6ecfa4c1aabd60edb7f5c31556444ddcd3d7f.zip
gcc-89c6ecfa4c1aabd60edb7f5c31556444ddcd3d7f.tar.gz
gcc-89c6ecfa4c1aabd60edb7f5c31556444ddcd3d7f.tar.bz2
PR c++/82039 suppress -Wzero-as-null-pointer-constant warning
PR c++/82039 * include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate): Adjust null pointer constant to avoid warning. From-SVN: r251570
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/ext/new_allocator.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index cfc1ed3..ed1003a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h
index ee64b9c..e1e152c 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();