[libcxx-commits] [libcxx] [libc++] Move swap test to a .compile.pass.cpp (PR #143167)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 6 09:20:36 PDT 2025


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/143167

None

>From 86126e729e77ceaf8c25e89400378d64ca1328ee Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Fri, 6 Jun 2025 12:20:14 -0400
Subject: [PATCH] [libc++] Move swap test to a .compile.pass.cpp

---
 ...{swap_noexcept.pass.cpp => swap_noexcept.compile.pass.cpp} | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
 rename libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/{swap_noexcept.pass.cpp => swap_noexcept.compile.pass.cpp} (98%)

diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
similarity index 98%
rename from libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
rename to libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
index b83ec3c3c1210..b50e67589471d 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
@@ -52,7 +52,7 @@ struct some_alloc2 {
   typedef std::true_type is_always_equal;
 };
 
-int main(int, char**) {
+void f() {
   {
     typedef std::forward_list<MoveOnly> C;
     static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -83,6 +83,4 @@ int main(int, char**) {
     static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
   }
 #endif
-
-  return 0;
 }



More information about the libcxx-commits mailing list