+2019-02-05 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/89090
+ * include/bits/stl_uninitialized.h (__relocate_a_1): Make unused
+ parameter unnamed. Add message to static assertion.
+ * include/bits/vector.tcc (vector::reserve, vector::_M_realloc_insert)
+ (vector::_M_default_append): Use _GLIBCXX17_CONSTEXPR for if constexpr
+ in C++11 code.
+
2019-02-05 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/87106
template <typename _Tp, typename _Up>
inline __enable_if_t<std::__is_bitwise_relocatable<_Tp>::value, _Tp*>
__relocate_a_1(_Tp* __first, _Tp* __last,
- _Tp* __result, allocator<_Up>& __alloc) noexcept
+ _Tp* __result, allocator<_Up>&) noexcept
{
ptrdiff_t __count = __last - __first;
if (__count > 0)
_ValueType;
typedef typename iterator_traits<_ForwardIterator>::value_type
_ValueType2;
- static_assert(std::is_same<_ValueType, _ValueType2>::value);
+ static_assert(std::is_same<_ValueType, _ValueType2>::value,
+ "relocation is only possible for values of the same type");
_ForwardIterator __cur = __result;
for (; __first != __last; ++__first, (void)++__cur)
std::__relocate_object_a(std::__addressof(*__cur),
const size_type __old_size = size();
pointer __tmp;
#if __cplusplus >= 201103L
- if constexpr (_S_use_relocate())
+ if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
{
__tmp = this->_M_allocate(__n);
std::__relocate_a(this->_M_impl._M_start,
__new_finish = pointer();
#if __cplusplus >= 201103L
- if constexpr (_S_use_relocate())
+ if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
{
__new_finish
= std::__relocate_a
__throw_exception_again;
}
#if __cplusplus >= 201103L
- if constexpr (!_S_use_relocate())
+ if _GLIBCXX17_CONSTEXPR (!_S_use_relocate())
#endif
std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator());
_GLIBCXX_ASAN_ANNOTATE_REINIT;
const size_type __len =
_M_check_len(__n, "vector::_M_default_append");
pointer __new_start(this->_M_allocate(__len));
-#if __cplusplus >= 201103L
- if constexpr (_S_use_relocate())
+ if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
{
__try
{
__new_start, _M_get_Tp_allocator());
}
else
-#endif
{
pointer __destroy_from = pointer();
__try