From 7adf713a5e22b44c7cc746bcd379d844277a19f2 Mon Sep 17 00:00:00 2001 From: Hyundeok Park Date: Tue, 22 Jun 2021 12:37:51 -0400 Subject: [PATCH] [libc++] Change forward_list::swap to use propagate_on_container_swap for noexcept specification The current implementation of `std::forward_list::swap` uses `propagate_on_container_move_assignment` for `noexcept` specification. This patch changes it to use `propagate_on_container_swap`, as it should. Fixes https://llvm.org/PR50224. Differential Revision: https://reviews.llvm.org/D101899 --- libcxx/include/forward_list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index 086e8ef..9622d9d 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -534,7 +534,7 @@ public: #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else - _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || + _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value); #endif protected: @@ -599,7 +599,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT #else - _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || + _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value) #endif { -- 2.7.4