@@ -1,5 +1,9 @@
2018-08-14 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/stl_tempbuf.h (get_temporary_buffer)
+ (return_temporary_buffer): Add deprecated attribute for C++17.
+ (_Temporary_buffer): Disable -Wdeprecated-declarations warnings.
+
PR libstdc++/86954
* include/bits/stl_tempbuf.h (return_temporary_buffer): Use
non-placement delete.
@@ -81,6 +81,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Provides the nothrow exception guarantee.
*/
template<typename _Tp>
+#if __cplusplus >= 201703L
+ _GLIBCXX_DEPRECATED
+#endif
pair<_Tp*, ptrdiff_t>
get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
{
@@ -108,11 +111,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Frees the memory pointed to by __p.
*/
template<typename _Tp>
+#if __cplusplus >= 201703L
+ _GLIBCXX_DEPRECATED
+#endif
inline void
return_temporary_buffer(_Tp* __p)
{ ::operator delete(__p); }
-
/**
* This class is used in two places: stl_algo.h and ext/memory,
* where it is wrapped as the temporary_buffer class. See
@@ -162,11 +167,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
_Temporary_buffer(_ForwardIterator __seed, size_type __original_len);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
~_Temporary_buffer()
{
std::_Destroy(_M_buffer, _M_buffer + _M_len);
std::return_temporary_buffer(_M_buffer);
}
+#pragma GCC diagnostic pop
private:
// Disable copy constructor and assignment operator.
@@ -239,6 +247,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__ucr(__first, __last, __seed);
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename _ForwardIterator, typename _Tp>
_Temporary_buffer<_ForwardIterator, _Tp>::
_Temporary_buffer(_ForwardIterator __seed, size_type __original_len)
@@ -262,6 +272,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__throw_exception_again;
}
}
+#pragma GCC diagnostic pop
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace