2019-01-24 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/88840
+ * include/bits/stl_vector.h (vector::__use_relocate): Replace static
+ data member with static member function _S_use_relocate().
+ * include/bits/vector.tcc (vector::reserve, vector::_M_realloc_insert)
+ (vector::_M_default_append): Use _S_use_relocate() instead of
+ __use_relocate.
+
* testsuite/27_io/filesystem/path/compare/strings.cc: Only compare
sign of results.
private:
#if __cplusplus >= 201103L
- static constexpr bool __use_relocate =
- noexcept(std::__relocate_a(std::declval<pointer>(),
- std::declval<pointer>(),
- std::declval<pointer>(),
- std::declval<_Tp_alloc_type&>()));
+ static constexpr bool
+ _S_use_relocate()
+ {
+ return noexcept(std::__relocate_a(std::declval<pointer>(),
+ std::declval<pointer>(),
+ std::declval<pointer>(),
+ std::declval<_Tp_alloc_type&>()));
+ }
#endif
protected:
const size_type __old_size = size();
pointer __tmp;
#if __cplusplus >= 201103L
- if constexpr (__use_relocate)
+ if 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 (__use_relocate)
+ if constexpr (_S_use_relocate())
{
__new_finish
= std::__relocate_a
__throw_exception_again;
}
#if __cplusplus >= 201103L
- if constexpr (!__use_relocate)
+ if constexpr (!_S_use_relocate())
#endif
std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator());
_GLIBCXX_ASAN_ANNOTATE_REINIT;
_M_check_len(__n, "vector::_M_default_append");
pointer __new_start(this->_M_allocate(__len));
#if __cplusplus >= 201103L
- if constexpr (__use_relocate)
+ if constexpr (_S_use_relocate())
{
__try
{