[libcxx-commits] [libcxx] [libc++] Simplify a bunch of noexcept specifications (PR #166397)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 19 08:12:44 PST 2025


================
@@ -740,17 +740,14 @@ public:
   _LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u, const allocator_type& __a);
   _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u) _NOEXCEPT_(
       is_nothrow_move_constructible<__bucket_list>::value&& is_nothrow_move_constructible<__first_node>::value&&
-          is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<hasher>::value&&
-              is_nothrow_move_constructible<key_equal>::value);
+          is_nothrow_move_constructible<hasher>::value&& is_nothrow_move_constructible<key_equal>::value);
   _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u, const allocator_type& __a);
   _LIBCPP_HIDE_FROM_ABI ~__hash_table();
 
   _LIBCPP_HIDE_FROM_ABI __hash_table& operator=(const __hash_table& __u);
   _LIBCPP_HIDE_FROM_ABI __hash_table& operator=(__hash_table&& __u)
-      _NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value &&
-                 ((__node_traits::propagate_on_container_move_assignment::value &&
-                   is_nothrow_move_assignable<__node_allocator>::value) ||
-                  allocator_traits<__node_allocator>::is_always_equal::value));
+      _NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value&&
+                     __is_allocator_aware_container_move_nothrow_v<allocator_type>);
----------------
ldionne wrote:

Let's add a libc++ specific test for these properties that we were apparently not testing previously.

Or if we're already testing this somehow, there should be a test changing in `std::unordered_map` and friends.

https://github.com/llvm/llvm-project/pull/166397


More information about the libcxx-commits mailing list