[libcxx-commits] [libcxx] 7adf713 - [libc++] Change forward_list::swap to use propagate_on_container_swap for noexcept specification
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 22 09:42:08 PDT 2021
Author: Hyundeok Park
Date: 2021-06-22T12:42:02-04:00
New Revision: 7adf713a5e22b44c7cc746bcd379d844277a19f2
URL: https://github.com/llvm/llvm-project/commit/7adf713a5e22b44c7cc746bcd379d844277a19f2
DIFF: https://github.com/llvm/llvm-project/commit/7adf713a5e22b44c7cc746bcd379d844277a19f2.diff
LOG: [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
Added:
Modified:
libcxx/include/forward_list
Removed:
################################################################################
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 086e8ef4ca6ae..9622d9d8f6016 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
{
More information about the libcxx-commits
mailing list