Some libstdc++ fixes for -Wdeprecated-copy.
* include/bits/stl_deque.h (_Deque_iterator): Constrain constructor for conversion to const_iterator. Add defaulted copy ops. * libsupc++/new (bad_alloc): Add defaulted copy ops. * libsupc++/exception.h (exception): Add defaulted copy ops. * include/std/system_error (system_error): Add defaulted copy ops. * include/std/stdexcept (domain_error, invalid_argument) (length_error, out_of_range, range_error, overflow_error) (underflow_error): Add defaulted copy ops. * include/bits/stl_iterator.h (reverse_iterator): Add defaulted copy assignment. * include/bits/allocator.h (allocator): Add defaulted copy assignment. * include/ext/throw_allocator.h (condition_base): Add defaulted default and copy ctor and copy assignment. From-SVN: r260380
This commit is contained in:
parent
1261e77e53
commit
f07c223768
10 changed files with 72 additions and 1 deletions
|
@ -5,4 +5,4 @@
|
|||
#include <new>
|
||||
__attribute__((visibility("hidden")))void*operator new(std::size_t); // { dg-warning "visibility attribute ignored" }
|
||||
|
||||
// { dg-message "previous declaration" "" { target *-*-* } 120 }
|
||||
// { dg-message "previous declaration" "" { target *-*-* } 125 }
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
2018-05-18 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* include/bits/stl_deque.h (_Deque_iterator): Constrain constructor
|
||||
for conversion to const_iterator. Add defaulted copy ops.
|
||||
* libsupc++/new (bad_alloc): Add defaulted copy ops.
|
||||
* libsupc++/exception.h (exception): Add defaulted copy ops.
|
||||
* include/std/system_error (system_error): Add defaulted copy ops.
|
||||
* include/std/stdexcept (domain_error, invalid_argument)
|
||||
(length_error, out_of_range, range_error, overflow_error)
|
||||
(underflow_error): Add defaulted copy ops.
|
||||
* include/bits/stl_iterator.h (reverse_iterator): Add defaulted
|
||||
copy assignment.
|
||||
* include/bits/allocator.h (allocator): Add defaulted copy assignment.
|
||||
* include/ext/throw_allocator.h (condition_base): Add defaulted
|
||||
default and copy ctor and copy assignment.
|
||||
|
||||
2018-05-18 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
PR libstdc++/85098
|
||||
|
|
|
@ -132,6 +132,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
|
||||
allocator(const allocator& __a) throw()
|
||||
: __allocator_base<_Tp>(__a) { }
|
||||
#if __cplusplus >= 201103L
|
||||
// Avoid implicit deprecation.
|
||||
allocator& operator=(const allocator&) = default;
|
||||
#endif
|
||||
|
||||
template<typename _Tp1>
|
||||
allocator(const allocator<_Tp1>&) throw() { }
|
||||
|
|
|
@ -149,9 +149,23 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
|||
_Deque_iterator() _GLIBCXX_NOEXCEPT
|
||||
: _M_cur(), _M_first(), _M_last(), _M_node() { }
|
||||
|
||||
#if __cplusplus < 201103L
|
||||
// Conversion from iterator to const_iterator.
|
||||
_Deque_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT
|
||||
: _M_cur(__x._M_cur), _M_first(__x._M_first),
|
||||
_M_last(__x._M_last), _M_node(__x._M_node) { }
|
||||
#else
|
||||
// Conversion from iterator to const_iterator.
|
||||
template<typename _Iter,
|
||||
typename = _Require<is_same<_Self, const_iterator>,
|
||||
is_same<_Iter, iterator>>>
|
||||
_Deque_iterator(const _Iter& __x) noexcept
|
||||
: _M_cur(__x._M_cur), _M_first(__x._M_first),
|
||||
_M_last(__x._M_last), _M_node(__x._M_node) { }
|
||||
|
||||
_Deque_iterator(const _Deque_iterator&) = default;
|
||||
_Deque_iterator& operator=(const _Deque_iterator&) = default;
|
||||
#endif
|
||||
|
||||
iterator
|
||||
_M_const_cast() const _GLIBCXX_NOEXCEPT
|
||||
|
|
|
@ -138,6 +138,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
reverse_iterator(const reverse_iterator& __x)
|
||||
: current(__x.current) { }
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
reverse_iterator& operator=(const reverse_iterator&) = default;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A %reverse_iterator across other types can be copied if the
|
||||
* underlying %iterator can be converted to the type of @c current.
|
||||
|
|
|
@ -402,6 +402,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
*/
|
||||
struct condition_base
|
||||
{
|
||||
#if __cplusplus >= 201103L
|
||||
condition_base() = default;
|
||||
condition_base(const condition_base&) = default;
|
||||
condition_base& operator=(const condition_base&) = default;
|
||||
#endif
|
||||
virtual ~condition_base() { };
|
||||
};
|
||||
|
||||
|
|
|
@ -150,6 +150,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit domain_error(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit domain_error(const char*) _GLIBCXX_TXN_SAFE;
|
||||
domain_error(const domain_error&) = default;
|
||||
domain_error& operator=(const domain_error&) = default;
|
||||
#endif
|
||||
virtual ~domain_error() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -161,6 +163,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit invalid_argument(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit invalid_argument(const char*) _GLIBCXX_TXN_SAFE;
|
||||
invalid_argument(const invalid_argument&) = default;
|
||||
invalid_argument& operator=(const invalid_argument&) = default;
|
||||
#endif
|
||||
virtual ~invalid_argument() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -173,6 +177,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit length_error(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit length_error(const char*) _GLIBCXX_TXN_SAFE;
|
||||
length_error(const length_error&) = default;
|
||||
length_error& operator=(const length_error&) = default;
|
||||
#endif
|
||||
virtual ~length_error() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -185,6 +191,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit out_of_range(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit out_of_range(const char*) _GLIBCXX_TXN_SAFE;
|
||||
out_of_range(const out_of_range&) = default;
|
||||
out_of_range& operator=(const out_of_range&) = default;
|
||||
#endif
|
||||
virtual ~out_of_range() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -233,6 +241,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit range_error(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit range_error(const char*) _GLIBCXX_TXN_SAFE;
|
||||
range_error(const range_error&) = default;
|
||||
range_error& operator=(const range_error&) = default;
|
||||
#endif
|
||||
virtual ~range_error() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -244,6 +254,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit overflow_error(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit overflow_error(const char*) _GLIBCXX_TXN_SAFE;
|
||||
overflow_error(const overflow_error&) = default;
|
||||
overflow_error& operator=(const overflow_error&) = default;
|
||||
#endif
|
||||
virtual ~overflow_error() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
@ -255,6 +267,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
explicit underflow_error(const string& __arg) _GLIBCXX_TXN_SAFE;
|
||||
#if __cplusplus >= 201103L
|
||||
explicit underflow_error(const char*) _GLIBCXX_TXN_SAFE;
|
||||
underflow_error(const underflow_error&) = default;
|
||||
underflow_error& operator=(const underflow_error&) = default;
|
||||
#endif
|
||||
virtual ~underflow_error() _GLIBCXX_USE_NOEXCEPT;
|
||||
};
|
||||
|
|
|
@ -364,6 +364,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
: runtime_error(__what + ": " + error_code(__v, __ecat).message()),
|
||||
_M_code(__v, __ecat) { }
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
system_error (const system_error &) = default;
|
||||
system_error &operator= (const system_error &) = default;
|
||||
#endif
|
||||
|
||||
virtual ~system_error() noexcept;
|
||||
|
||||
const error_code&
|
||||
|
|
|
@ -62,6 +62,10 @@ namespace std
|
|||
public:
|
||||
exception() _GLIBCXX_USE_NOEXCEPT { }
|
||||
virtual ~exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
|
||||
#if __cplusplus >= 201103L
|
||||
exception(const exception&) = default;
|
||||
exception& operator=(const exception&) = default;
|
||||
#endif
|
||||
|
||||
/** Returns a C-style character string describing the general cause
|
||||
* of the current error. */
|
||||
|
|
|
@ -56,6 +56,11 @@ namespace std
|
|||
public:
|
||||
bad_alloc() throw() { }
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
bad_alloc(const bad_alloc&) = default;
|
||||
bad_alloc& operator=(const bad_alloc&) = default;
|
||||
#endif
|
||||
|
||||
// This declaration is not useless:
|
||||
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
|
||||
virtual ~bad_alloc() throw();
|
||||
|
|
Loading…
Add table
Reference in a new issue