aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-08-14 21:19:20 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-08-14 21:19:20 +0100
commitaa7df52e4f86b6a92ab236895a85ce2cb7b1a98b (patch)
tree419f83c3b76cd023643bafb8ff8cb013c8e24a9d
parent2b1aedf3ac3883af176555bea621c6c8a7a46be7 (diff)
downloadgcc-aa7df52e4f86b6a92ab236895a85ce2cb7b1a98b.zip
gcc-aa7df52e4f86b6a92ab236895a85ce2cb7b1a98b.tar.gz
gcc-aa7df52e4f86b6a92ab236895a85ce2cb7b1a98b.tar.bz2
PR libstdc++/86954 use non-placement operator delete
As explained in the PR, there's no reason to call the nothrow delete, we can just use the normal one. PR libstdc++/86954 * include/bits/stl_tempbuf.h (return_temporary_buffer): Use non-placement delete. From-SVN: r263542
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/bits/stl_tempbuf.h8
2 files changed, 8 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index cf69f21..182c0ed 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2018-08-14 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/86954
+ * include/bits/stl_tempbuf.h (return_temporary_buffer): Use
+ non-placement delete.
+
* include/std/chrono (__check_overflow): Simplify definition.
(_Checked_integral_constant): Remove.
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h
index 159ee27..0abd3c1 100644
--- a/libstdc++-v3/include/bits/stl_tempbuf.h
+++ b/libstdc++-v3/include/bits/stl_tempbuf.h
@@ -88,10 +88,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
if (__len > __max)
__len = __max;
-
- while (__len > 0)
+
+ while (__len > 0)
{
- _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
+ _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
std::nothrow));
if (__tmp != 0)
return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
@@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
inline void
return_temporary_buffer(_Tp* __p)
- { ::operator delete(__p, std::nothrow); }
+ { ::operator delete(__p); }
/**