* include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define.
* include/bits/forward_list.h (forward_list::swap): Make noexcept
unconditional.
* include/bits/hashtable.h (_Hashtable::swap): Do not use
_S_nothrow_swap().
* include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept
unconditional.
* include/bits/stl_deque.h (deque::swap): Likewise.
(swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF.
* include/bits/stl_list.h (list::swap): Make noexcept unconditional.
(swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF.
* include/bits/stl_map.h (map::swap, swap(map&, map&)): Use
_GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap.
* include/bits/stl_multimap.h (multimap::swap,
swap(multimap&, multimap&)): Likewise.
* include/bits/stl_multiset.h (multiset::swap,
swap(multiset&, multiset&)): Likewise.
* include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise.
* include/bits/stl_tree.h (_Rb_tree::swap,
swap(_Rb_tree&, _Rb_tree&)): Likewise.
* include/bits/stl_vector.h (vector::swap): Make noexcept
unconditional.
(swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF.
* include/debug/deque (deque::swap, swap): Likewise.
* include/debug/forward_list (swap): Add noexcept.
* include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF.
* include/debug/map.h (map::swap, swap): Likewise.
* include/debug/multimap.h (multimap::swap, swap): Likewise.
* include/debug/multiset.h (multiset::Swap, swap): Likewise.
* include/debug/set.h (set::swap, swap): Likewise.
* include/debug/unordered_map (unordered_map::swap,
unordered_multimap::swap, swap): Likewise.
* include/debug/unordered_set (unordered_set::swap,
unordered_multiset::swap, swap): Likewise.
* include/debug/vector (vector::swap, swap): Likewise.
* include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()):
Remove.
* include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF.
* include/profile/forward_list (swap): Add noexcept.
* include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF.
* include/profile/map.h (map::swap, swap): Likewise.
* include/profile/multimap.h (multimap::swap, swap): Likewise.
* include/profile/multiset.h (multiset::swap, swap): Likewise.
* include/profile/set.h (set::swap, swap): Likewise.
* include/profile/unordered_map (swap): Likewise.
* include/profile/unordered_set (swap): Likewise.
* include/profile/vector (vector::swap, swap): Likewise. Remove
overloads for swapping rvalues.
* testsuite/23_containers/deque/allocator/noexcept.cc: Update tests
for noexcept on swap.
* testsuite/23_containers/forward_list/allocator/noexcept.cc:
Likewise.
* testsuite/23_containers/list/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/map/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/set/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/unordered_map/allocator/noexcept.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/allocator/noexcept.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/allocator/noexcept.cc:
Likewise.
* testsuite/23_containers/unordered_set/allocator/noexcept.cc:
Likewise.
* testsuite/23_containers/vector/allocator/noexcept.cc: Likewise.
* testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise.
* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line
number.
From-SVN: r225744
+2015-07-13 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define.
+ * include/bits/forward_list.h (forward_list::swap): Make noexcept
+ unconditional.
+ * include/bits/hashtable.h (_Hashtable::swap): Do not use
+ _S_nothrow_swap().
+ * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept
+ unconditional.
+ * include/bits/stl_deque.h (deque::swap): Likewise.
+ (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF.
+ * include/bits/stl_list.h (list::swap): Make noexcept unconditional.
+ (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF.
+ * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use
+ _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap.
+ * include/bits/stl_multimap.h (multimap::swap,
+ swap(multimap&, multimap&)): Likewise.
+ * include/bits/stl_multiset.h (multiset::swap,
+ swap(multiset&, multiset&)): Likewise.
+ * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise.
+ * include/bits/stl_tree.h (_Rb_tree::swap,
+ swap(_Rb_tree&, _Rb_tree&)): Likewise.
+ * include/bits/stl_vector.h (vector::swap): Make noexcept
+ unconditional.
+ (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF.
+ * include/debug/deque (deque::swap, swap): Likewise.
+ * include/debug/forward_list (swap): Add noexcept.
+ * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF.
+ * include/debug/map.h (map::swap, swap): Likewise.
+ * include/debug/multimap.h (multimap::swap, swap): Likewise.
+ * include/debug/multiset.h (multiset::Swap, swap): Likewise.
+ * include/debug/set.h (set::swap, swap): Likewise.
+ * include/debug/unordered_map (unordered_map::swap,
+ unordered_multimap::swap, swap): Likewise.
+ * include/debug/unordered_set (unordered_set::swap,
+ unordered_multiset::swap, swap): Likewise.
+ * include/debug/vector (vector::swap, swap): Likewise.
+ * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()):
+ Remove.
+ * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF.
+ * include/profile/forward_list (swap): Add noexcept.
+ * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF.
+ * include/profile/map.h (map::swap, swap): Likewise.
+ * include/profile/multimap.h (multimap::swap, swap): Likewise.
+ * include/profile/multiset.h (multiset::swap, swap): Likewise.
+ * include/profile/set.h (set::swap, swap): Likewise.
+ * include/profile/unordered_map (swap): Likewise.
+ * include/profile/unordered_set (swap): Likewise.
+ * include/profile/vector (vector::swap, swap): Likewise. Remove
+ overloads for swapping rvalues.
+ * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests
+ for noexcept on swap.
+ * testsuite/23_containers/forward_list/allocator/noexcept.cc:
+ Likewise.
+ * testsuite/23_containers/list/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/map/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/set/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/unordered_map/allocator/noexcept.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_set/allocator/noexcept.cc:
+ Likewise.
+ * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise.
+ * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise.
+ * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line
+ number.
+
2015-07-13 John Marino <gnugcc@marino.st>
* config/os/bsd/dragonfly/os_defines.h (_GLIBCXX_USE_C99_CHECK,
#ifndef _GLIBCXX_NOEXCEPT
# if __cplusplus >= 201103L
# define _GLIBCXX_NOEXCEPT noexcept
+# define _GLIBCXX_NOEXCEPT_IF(_COND) noexcept(_COND)
# define _GLIBCXX_USE_NOEXCEPT noexcept
# define _GLIBCXX_THROW(_EXC)
# else
# define _GLIBCXX_NOEXCEPT
+# define _GLIBCXX_NOEXCEPT_IF(_COND)
# define _GLIBCXX_USE_NOEXCEPT throw()
# define _GLIBCXX_THROW(_EXC) throw(_EXC)
# endif
* function.
*/
void
- swap(forward_list& __list)
- noexcept(_Node_alloc_traits::_S_nothrow_swap())
+ swap(forward_list& __list) noexcept
{
std::swap(this->_M_impl._M_head._M_next,
__list._M_impl._M_head._M_next);
void
swap(_Hashtable&)
- noexcept(__node_alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_H1>::value
+ noexcept(__is_nothrow_swappable<_H1>::value
&& __is_nothrow_swappable<_Equal>::value);
// Basic container operations
_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>::
swap(_Hashtable& __x)
- noexcept(__node_alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_H1>::value
+ noexcept(__is_nothrow_swappable<_H1>::value
&& __is_nothrow_swappable<_Equal>::value)
{
// The only base class with member variables is hash_code_base.
}
void
- swap(vector& __x)
-#if __cplusplus >= 201103L
- noexcept(_Bit_alloc_traits::_S_nothrow_swap())
-#endif
+ swap(vector& __x) _GLIBCXX_NOEXCEPT
{
std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
* std::swap(d1,d2) will feed to this function.
*/
void
- swap(deque& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap())
-#endif
+ swap(deque& __x) _GLIBCXX_NOEXCEPT
{
_M_impl._M_swap_data(__x._M_impl);
_Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
template<typename _Tp, typename _Alloc>
inline void
swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
#undef _GLIBCXX_DEQUE_BUF_SIZE
* function.
*/
void
- swap(list& __x)
-#if __cplusplus >= 201103L
- noexcept(_Node_alloc_traits::_S_nothrow_swap())
-#endif
+ swap(list& __x) _GLIBCXX_NOEXCEPT
{
__detail::_List_node_base::swap(this->_M_impl._M_node,
__x._M_impl._M_node);
template<typename _Tp, typename _Alloc>
inline void
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
*/
void
swap(map& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_Compare>::value)
-#endif
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
{ _M_t.swap(__x._M_t); }
/**
inline void
swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
map<_Key, _Tp, _Compare, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
*/
void
swap(multimap& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_Compare>::value)
-#endif
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
{ _M_t.swap(__x._M_t); }
/**
inline void
swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
multimap<_Key, _Tp, _Compare, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
*/
void
swap(multiset& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_Compare>::value)
-#endif
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
{ _M_t.swap(__x._M_t); }
// insert/erase
inline void
swap(multiset<_Key, _Compare, _Alloc>& __x,
multiset<_Key, _Compare, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
*/
void
swap(set& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap()
- && __is_nothrow_swappable<_Compare>::value)
-#endif
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
{ _M_t.swap(__x._M_t); }
// insert/erase
template<typename _Key, typename _Compare, typename _Alloc>
inline void
swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
{ return _Alloc_traits::max_size(_M_get_Node_allocator()); }
void
-#if __cplusplus >= 201103L
- swap(_Rb_tree& __t) noexcept(_Alloc_traits::_S_nothrow_swap());
-#else
- swap(_Rb_tree& __t);
-#endif
+ swap(_Rb_tree& __t)
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value);
// Insert/erase.
#if __cplusplus >= 201103L
typename _Compare, typename _Alloc>
void
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
- swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap())
-#endif
+ swap(_Rb_tree& __t)
+ _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
{
if (_M_root() == 0)
{
* std::swap(v1,v2) will feed to this function.
*/
void
- swap(vector& __x)
-#if __cplusplus >= 201103L
- noexcept(_Alloc_traits::_S_nothrow_swap())
-#endif
+ swap(vector& __x) _GLIBCXX_NOEXCEPT
{
this->_M_impl._M_swap_data(__x._M_impl);
_Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
-#if __cplusplus >= 201103L
- noexcept(noexcept(__x.swap(__y)))
-#endif
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
void
swap(deque& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
template<typename _Tp, typename _Alloc>
inline void
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __debug
void
swap(forward_list& __list)
- noexcept( noexcept(declval<_Base>().swap(__list)) )
+ noexcept( noexcept(declval<_Base&>().swap(__list)) )
{
_Safe::_M_swap(__list);
_Base::swap(__list);
/// See std::forward_list::swap().
template<typename _Tp, typename _Alloc>
inline void
- swap(forward_list<_Tp, _Alloc>& __lx,
- forward_list<_Tp, _Alloc>& __ly)
+ swap(forward_list<_Tp, _Alloc>& __lx, forward_list<_Tp, _Alloc>& __ly)
+ noexcept(noexcept(__lx.swap(__ly)))
{ __lx.swap(__ly); }
} // namespace __debug
void
swap(list& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
template<typename _Tp, typename _Alloc>
inline void
swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __debug
void
swap(map& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __debug
void
swap(multimap& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __debug
void
swap(multiset& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
void
swap(multiset<_Key, _Compare, _Allocator>& __x,
multiset<_Key, _Compare, _Allocator>& __y)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ return __x.swap(__y); }
} // namespace __debug
void
swap(set& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
void
swap(set<_Key, _Compare, _Allocator>& __x,
set<_Key, _Compare, _Allocator>& __y)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ return __x.swap(__y); }
} // namespace __debug
void
swap(unordered_map& __x)
- noexcept( noexcept(declval<_Base>().swap(__x)) )
+ noexcept( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
void
swap(unordered_multimap& __x)
- noexcept( noexcept(declval<_Base>().swap(__x)) )
+ noexcept( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
void
swap(unordered_set& __x)
- noexcept( noexcept(declval<_Base>().swap(__x)) )
+ noexcept( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
void
swap(unordered_multiset& __x)
- noexcept( noexcept(declval<_Base>().swap(__x)) )
+ noexcept( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
inline void
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
void
swap(vector& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Safe::_M_swap(__x);
_Base::swap(__x);
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __debug
static constexpr bool _S_nothrow_move()
{ return _S_propagate_on_move_assign() || _S_always_equal(); }
- static constexpr bool _S_nothrow_swap()
- {
- return !_S_propagate_on_swap()
- || std::__is_nothrow_swappable<_Alloc>::value;
- }
-
template<typename _Tp>
struct rebind
{ typedef typename _Base_type::template rebind_alloc<_Tp> other; };
void
swap(deque& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{ _Base::swap(__x); }
_Base&
template<typename _Tp, typename _Alloc>
inline void
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __profile
void
swap(forward_list& __fl)
- noexcept( noexcept(declval<_Base>().swap(__fl)) )
+ noexcept( noexcept(declval<_Base&>().swap(__fl)) )
{ _Base::swap(__fl); }
void
inline void
swap(forward_list<_Tp, _Alloc>& __lx,
forward_list<_Tp, _Alloc>& __ly)
+ noexcept(noexcept(__lx.swap(__ly)))
{ __lx.swap(__ly); }
} // namespace __profile
void
swap(list& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Base::swap(__x);
this->_M_swap(__x);
template<typename _Tp, typename _Alloc>
inline void
swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __profile
void
swap(map& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Base::swap(__x);
this->_M_swap(__x);
inline void
swap(map<_Key, _Tp, _Compare, _Allocator>& __lhs,
map<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __profile
void
swap(multimap& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
std::swap(this->_M_map2umap_info, __x._M_map2umap_info);
_Base::swap(__x);
inline void
swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __profile
void
swap(multiset& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Base::swap(__x);
this->_M_swap(__x);
void
swap(multiset<_Key, _Compare, _Allocator>& __x,
multiset<_Key, _Compare, _Allocator>& __y)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ return __x.swap(__y); }
} // namespace __profile
void
swap(set& __x)
-#if __cplusplus >= 201103L
- noexcept( noexcept(declval<_Base>().swap(__x)) )
-#endif
+ _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{
_Base::swap(__x);
this->_M_swap(__x);
void
swap(set<_Key, _Compare, _Allocator>& __x,
set<_Key, _Compare, _Allocator>& __y)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
{ return __x.swap(__y); }
} // namespace __profile
inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
inline void
swap(unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline void
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
+ noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
-#if __cplusplus >= 201103L
- template<typename _Tp, typename _Alloc>
- inline void
- swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
- { __lhs.swap(__rhs); }
-
- template<typename _Tp, typename _Alloc>
- inline void
- swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
- { __lhs.swap(__rhs); }
-#endif
-
} // namespace __profile
#if __cplusplus >= 201103L
struct T { int i; };
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
-
using __gnu_test::propagating_allocator;
void test01()
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
// static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- // noexcept spec of deque::swap depends on swap overload at top of this file
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
struct T { int i; };
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
-
using __gnu_test::propagating_allocator;
void test01()
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
struct T { int i; };
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
-
using __gnu_test::propagating_allocator;
void test01()
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
using Cmp = std::less<T>;
-struct U { };
+struct CmpThrow : Cmp { };
+void swap(CmpThrow&, CmpThrow&) noexcept(false) { }
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+struct U { };
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<std::pair<const T, U>> alloc_type;
+ typedef std::map<T, U, CmpThrow, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
{
typedef propagating_allocator<std::pair<const T, U>, false> alloc_type;
typedef std::map<T, U, Cmp, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test04()
{
typedef propagating_allocator<std::pair<const T, U>, true> alloc_type;
typedef std::map<T, U, Cmp, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
using Cmp = std::less<T>;
-struct U { };
+struct CmpThrow : Cmp { };
+void swap(CmpThrow&, CmpThrow&) noexcept(false) { }
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+struct U { };
using __gnu_test::propagating_allocator;
void test02()
{
- typedef propagating_allocator<std::pair<const T, U>, false> alloc_type;
- typedef std::multimap<T, U, Cmp, alloc_type> test_type;
- test_type v1(alloc_type(1));
- test_type v2(alloc_type(2));
- static_assert( !noexcept( v1 = std::move(v2) ), "Move assign can throw" );
- static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
+ typedef std::allocator<std::pair<const T, U>> alloc_type;
+ typedef std::multimap<T, U, CmpThrow, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
}
void test03()
{
- typedef propagating_allocator<std::pair<const T, U>, true> alloc_type;
+ typedef propagating_allocator<std::pair<const T, U>, false> alloc_type;
typedef std::multimap<T, U, Cmp, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
- static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( !noexcept( v1 = std::move(v2) ), "Move assign can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
using Cmp = std::less<T>;
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+struct CmpThrow : Cmp { };
+void swap(CmpThrow&, CmpThrow&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::multiset<T, CmpThrow, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::multiset<T, Cmp, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test04()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::multiset<T, Cmp, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
using Cmp = std::less<T>;
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+struct CmpThrow : Cmp { };
+void swap(CmpThrow&, CmpThrow&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::set<T, CmpThrow, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::set<T, Cmp, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test04()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::set<T, Cmp, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
{ return lhs.i == rhs.i; }
};
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+// Versions of the function objects without nothrow swap.
+struct hash_t : hash { };
+void swap(hash_t&, hash_t&) noexcept(false) { }
+struct equal_to_t : equal_to { };
+void swap(equal_to_t&, equal_to_t&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_map<T, T, hash_t, equal_to, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_map<T, T, hash, equal_to_t, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test04()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test05()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::unordered_map<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test04()
+void test06()
{
typedef std::unordered_map<int, int> test_type;
- static_assert( noexcept( test_type() ), "Default constructor do not throw" );
- static_assert( noexcept( test_type(test_type()) ), "Move constructor do not throw" );
+ static_assert( noexcept( test_type() ), "Default constructor does not throw" );
+ static_assert( noexcept( test_type(test_type()) ), "Move constructor does not throw" );
}
{ return lhs.i == rhs.i; }
};
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+// Versions of the function objects without nothrow swap.
+struct hash_t : hash { };
+void swap(hash_t&, hash_t&) noexcept(false) { }
+struct equal_to_t : equal_to { };
+void swap(equal_to_t&, equal_to_t&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_multimap<T, T, hash_t, equal_to, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_multimap<T, T, hash, equal_to_t, alloc_type>
+ test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test04()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test05()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::unordered_multimap<T, T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test04()
+void test06()
{
typedef std::unordered_multimap<int, int> test_type;
- static_assert( noexcept( test_type() ), "Default constructor do not throw" );
- static_assert( noexcept( test_type(test_type()) ), "Move constructor do not throw" );
+ static_assert( noexcept( test_type() ), "Default constructor does not throw" );
+ static_assert( noexcept( test_type(test_type()) ), "Move constructor does not throw" );
}
{ return lhs.i == rhs.i; }
};
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+// Versions of the function objects without nothrow swap.
+struct hash_t : hash { };
+void swap(hash_t&, hash_t&) noexcept(false) { }
+struct equal_to_t : equal_to { };
+void swap(equal_to_t&, equal_to_t&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_multiset<T, hash_t, equal_to, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_multiset<T, hash, equal_to_t, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test04()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::unordered_multiset<T, hash, equal_to, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test05()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::unordered_multiset<T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test04()
+void test06()
{
typedef std::unordered_multiset<int> test_type;
- static_assert( noexcept( test_type() ), "Default constructor do not throw" );
- static_assert( noexcept( test_type(test_type()) ), "Move constructor do not throw" );
+ static_assert( noexcept( test_type() ), "Default constructor does not throw" );
+ static_assert( noexcept( test_type(test_type()) ), "Move constructor does not throw" );
}
{ return lhs.i == rhs.i; }
};
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
+// Versions of the function objects without nothrow swap.
+struct hash_t : hash { };
+void swap(hash_t&, hash_t&) noexcept(false) { }
+struct equal_to_t : equal_to { };
+void swap(equal_to_t&, equal_to_t&) noexcept(false) { }
using __gnu_test::propagating_allocator;
}
void test02()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_set<T, hash_t, equal_to, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test03()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::unordered_set<T, hash, equal_to_t, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+void test04()
{
typedef propagating_allocator<T, false> alloc_type;
typedef std::unordered_set<T, hash, equal_to, alloc_type> test_type;
static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test03()
+void test05()
{
typedef propagating_allocator<T, true> alloc_type;
typedef std::unordered_set<T, hash, equal_to, alloc_type> test_type;
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
-void test04()
+void test06()
{
typedef std::unordered_set<int> test_type;
- static_assert( noexcept( test_type() ), "Default constructor do not throw" );
- static_assert( noexcept( test_type(test_type()) ), "Move constructor do not throw" );
+ static_assert( noexcept( test_type() ), "Default constructor does not throw" );
+ static_assert( noexcept( test_type(test_type()) ), "Move constructor does not throw" );
}
struct T { int i; };
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
-
using __gnu_test::propagating_allocator;
void test01()
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
using T = bool;
-namespace __gnu_test
-{
- template<typename U>
- inline void
- swap(propagating_allocator<U, true>& l, propagating_allocator<U, true>& r)
- noexcept(false)
- { }
-}
-
using __gnu_test::propagating_allocator;
void test01()
test_type v1(alloc_type(1));
test_type v2(alloc_type(2));
static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
- static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
}
#include <vector>
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 322 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 324 }
// "template argument 1 is invalid"
// { dg-prune-output "tuple:993" }