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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 5 03:07:23 PST 2025


================
@@ -29,25 +28,7 @@ struct some_alloc {
   void allocate(std::size_t);
 };
 
-int main(int, char**) {
-#if defined(_LIBCPP_VERSION)
-  {
-    typedef std::forward_list<MoveOnly> C;
-    static_assert(std::is_nothrow_move_constructible<C>::value, "");
-  }
-  {
-    typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
-    static_assert(std::is_nothrow_move_constructible<C>::value, "");
-  }
-  {
-    typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
-    static_assert(std::is_nothrow_move_constructible<C>::value, "");
-  }
-  {
-    typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
-    static_assert(!std::is_nothrow_move_constructible<C>::value, "");
-  }
-#endif // _LIBCPP_VERSION
-
-  return 0;
-}
+static_assert(std::is_nothrow_move_constructible<std::forward_list<MoveOnly>>::value, "");
----------------
frederick-vs-ja wrote:

This file should be renamed to `move_noexcept.compile.pass.cpp‎`.

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


More information about the libcxx-commits mailing list