diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-12-28 05:53:01 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-12-28 05:53:01 +0000 |
| commit | 780b51df1de3edc87c988964de00971d646c8c19 (patch) | |
| tree | 260a6c7f42857715ace00f03b01b36c212733977 /libcxx/include/string | |
| parent | 14bd0bf00811bd1a151c6559a14b53cd0c039b68 (diff) | |
| download | bcm5719-llvm-780b51df1de3edc87c988964de00971d646c8c19.tar.gz bcm5719-llvm-780b51df1de3edc87c988964de00971d646c8c19.zip | |
Add tests for unordered container tests and std::string
llvm-svn: 290655
Diffstat (limited to 'libcxx/include/string')
| -rw-r--r-- | libcxx/include/string | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index 2e5ffc1b6d0..98f538c38a0 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1105,9 +1105,9 @@ public: _LIBCPP_INLINE_VISIBILITY void swap(basic_string& __str) #if _LIBCPP_STD_VER >= 14 - _NOEXCEPT; + _NOEXCEPT_DEBUG; #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || + _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value); #endif @@ -2996,9 +2996,9 @@ inline _LIBCPP_INLINE_VISIBILITY void basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str) #if _LIBCPP_STD_VER >= 14 - _NOEXCEPT + _NOEXCEPT_DEBUG #else - _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || + _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value) #endif { @@ -3009,6 +3009,10 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str) __get_db()->__invalidate_all(&__str); __get_db()->swap(this, &__str); #endif + _LIBCPP_ASSERT( + __alloc_traits::propagate_on_container_swap::value || + __alloc_traits::is_always_equal::value || + __alloc() == __str.__alloc(), "swapping non-equal allocators"); _VSTD::swap(__r_.first(), __str.__r_.first()); __swap_allocator(__alloc(), __str.__alloc()); } |

