[libcxx-commits] [libcxx] 7f35f5f - [libc++] Refactor container's types.pass.cpp tests (#223602)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 18 00:01:27 PDT 2026


Author: Hristo Hristov
Date: 2026-09-18T10:01:20+03:00
New Revision: 7f35f5f2b2a4976725714beb35e3e0399fc7c4a7

URL: https://github.com/llvm/llvm-project/commit/7f35f5f2b2a4976725714beb35e3e0399fc7c4a7
DIFF: https://github.com/llvm/llvm-project/commit/7f35f5f2b2a4976725714beb35e3e0399fc7c4a7.diff

LOG: [libc++] Refactor container's types.pass.cpp tests (#223602)

Convert types.pass.cpp to compile-only tests because there is no runtime
component.

---------

Co-authored-by: Hristo Hristov <zingam at outlook.com>
Co-authored-by: A. Jiang <de34 at live.cn>
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>

Added: 
    libcxx/test/std/containers/associative/map/types.compile.pass.cpp
    libcxx/test/std/containers/associative/multimap/types.compile.pass.cpp
    libcxx/test/std/containers/associative/multiset/types.compile.pass.cpp
    libcxx/test/std/containers/associative/set/types.compile.pass.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/protected_members.pass.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/array/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/deque/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/list/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/types.compile.pass.cpp
    libcxx/test/std/containers/sequences/vector/types.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.map/types.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/types.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/types.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.set/types.compile.pass.cpp
    libcxx/test/std/containers/views/mdspan/mdspan/types.compile.pass.cpp
    libcxx/test/std/containers/views/views.span/types.compile.pass.cpp

Modified: 
    libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.fail.cpp

Removed: 
    libcxx/test/std/containers/associative/map/types.pass.cpp
    libcxx/test/std/containers/associative/multimap/types.pass.cpp
    libcxx/test/std/containers/associative/multiset/types.pass.cpp
    libcxx/test/std/containers/associative/set/types.pass.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
    libcxx/test/std/containers/sequences/array/types.pass.cpp
    libcxx/test/std/containers/sequences/deque/types.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
    libcxx/test/std/containers/sequences/list/types.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp
    libcxx/test/std/containers/sequences/vector/types.pass.cpp
    libcxx/test/std/containers/unord/unord.map/types.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/types.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/types.pass.cpp
    libcxx/test/std/containers/unord/unord.set/types.pass.cpp
    libcxx/test/std/containers/views/mdspan/mdspan/types.pass.cpp
    libcxx/test/std/containers/views/views.span/types.pass.cpp


################################################################################
diff  --git a/libcxx/test/std/containers/associative/map/types.pass.cpp b/libcxx/test/std/containers/associative/map/types.compile.pass.cpp
similarity index 95%
rename from libcxx/test/std/containers/associative/map/types.pass.cpp
rename to libcxx/test/std/containers/associative/map/types.compile.pass.cpp
index e69eb59081043..7f148fc7b287d 100644
--- a/libcxx/test/std/containers/associative/map/types.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/types.compile.pass.cpp
@@ -34,9 +34,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-TEST_CONSTEXPR_CXX26 bool test() {
+void test() {
   {
     typedef std::map<int, double> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::mapped_type, double>::value), "");
     static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
@@ -52,6 +53,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
 #if TEST_STD_VER >= 11
   {
     typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::mapped_type, double>::value), "");
     static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
@@ -66,13 +68,4 @@ TEST_CONSTEXPR_CXX26 bool test() {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-  return true;
-}
-
-int main(int, char**) {
-  test();
-#if TEST_STD_VER >= 26
-  static_assert(test());
-#endif
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/multimap/types.pass.cpp b/libcxx/test/std/containers/associative/multimap/types.compile.pass.cpp
similarity index 95%
rename from libcxx/test/std/containers/associative/multimap/types.pass.cpp
rename to libcxx/test/std/containers/associative/multimap/types.compile.pass.cpp
index 0f2d6190c1fc5..8d7626c8ba257 100644
--- a/libcxx/test/std/containers/associative/multimap/types.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/types.compile.pass.cpp
@@ -34,10 +34,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-TEST_CONSTEXPR_CXX26
-bool test() {
+void test() {
   {
     typedef std::multimap<int, double> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::mapped_type, double>::value), "");
     static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
@@ -53,6 +53,7 @@ bool test() {
 #if TEST_STD_VER >= 11
   {
     typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::mapped_type, double>::value), "");
     static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
@@ -67,15 +68,4 @@ bool test() {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return true;
-}
-
-int main(int, char**) {
-  test();
-
-#if TEST_STD_VER >= 26
-  static_assert(test());
-#endif
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/multiset/types.pass.cpp b/libcxx/test/std/containers/associative/multiset/types.compile.pass.cpp
similarity index 98%
rename from libcxx/test/std/containers/associative/multiset/types.pass.cpp
rename to libcxx/test/std/containers/associative/multiset/types.compile.pass.cpp
index 3595f7a8b5e0d..834353987acb8 100644
--- a/libcxx/test/std/containers/associative/multiset/types.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/types.compile.pass.cpp
@@ -34,9 +34,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main(int, char**) {
+void test() {
   {
     typedef std::multiset<int> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
@@ -52,6 +53,7 @@ int main(int, char**) {
 #if TEST_STD_VER >= 11
   {
     typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
@@ -66,6 +68,4 @@ int main(int, char**) {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/set/types.pass.cpp b/libcxx/test/std/containers/associative/set/types.compile.pass.cpp
similarity index 95%
rename from libcxx/test/std/containers/associative/set/types.pass.cpp
rename to libcxx/test/std/containers/associative/set/types.compile.pass.cpp
index c7376a16ae85a..19e678ff7f6b9 100644
--- a/libcxx/test/std/containers/associative/set/types.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/types.compile.pass.cpp
@@ -34,9 +34,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-TEST_CONSTEXPR_CXX26 bool test() {
+void test() {
   {
     typedef std::set<int> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
@@ -52,6 +53,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
 #if TEST_STD_VER >= 11
   {
     typedef std::set<int, std::less<int>, min_allocator<int>> C;
+
     static_assert((std::is_same<C::key_type, int>::value), "");
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
@@ -66,14 +68,4 @@ TEST_CONSTEXPR_CXX26 bool test() {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return true;
-}
-
-int main(int, char**) {
-  test();
-#if TEST_STD_VER >= 26
-  static_assert(test());
-#endif
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/container.adaptors/priority.queue/protected_members.pass.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/protected_members.pass.cpp
new file mode 100644
index 0000000000000..d0ee34f210a6b
--- /dev/null
+++ b/libcxx/test/std/containers/container.adaptors/priority.queue/protected_members.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+
+// template <class T, class Container = vector<T>,
+//           class Compare = less<typename Container::value_type>>
+// class priority_queue
+// {
+// protected:
+//     container_type c;
+//     Compare comp;
+
+#include <queue>
+#include <cassert>
+
+struct test_derived : private std::priority_queue<int> {
+  test_derived() {
+    c.push_back(1);
+    assert(comp(1, 2));
+  }
+};
+
+int main(int, char**) {
+  test_derived t;
+
+  return 0;
+}

diff  --git a/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.fail.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.fail.cpp
index 0dfbe06cf1839..3dce083537318 100644
--- a/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.fail.cpp
+++ b/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.fail.cpp
@@ -11,25 +11,12 @@
 // template <class T, class Container = vector<T>,
 //           class Compare = less<typename Container::value_type>>
 // class priority_queue
-// {
-// public:
-//     typedef Container                                container_type;
-//     typedef typename container_type::value_type      value_type;
-//     typedef typename container_type::reference       reference;
-//     typedef typename container_type::const_reference const_reference;
-//     typedef typename container_type::size_type       size_type;
-//
-// protected:
-//     container_type c;
-//     Compare comp;
 
 #include <queue>
 #include <cassert>
 #include <type_traits>
 
-int main(int, char**) {
+void test() {
   //  LWG#2566 says that the first template param must match the second one's value type
   std::priority_queue<double, std::deque<int>> t;
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.pass.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.pass.cpp
new file mode 100644
index 0000000000000..3de56b0a35be8
--- /dev/null
+++ b/libcxx/test/std/containers/container.adaptors/priority.queue/types.compile.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <queue>
+
+// template <class T, class Container = vector<T>,
+//           class Compare = less<typename Container::value_type>>
+// class priority_queue
+// {
+// public:
+//     typedef Container                                container_type;
+//     typedef Compare                                  value_compare; // LWG#2684
+//     typedef typename container_type::value_type      value_type;
+//     typedef typename container_type::reference       reference;
+//     typedef typename container_type::const_reference const_reference;
+//     typedef typename container_type::size_type       size_type;
+
+#include <queue>
+#include <deque>
+#include <functional>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+struct C {
+  typedef int value_type;
+  typedef int& reference;
+  typedef const int& const_reference;
+  typedef int size_type;
+};
+
+static_assert((std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), "");
+static_assert((std::is_same<std::priority_queue<int, std::deque<int> >::container_type, std::deque<int> >::value), "");
+static_assert((std::is_same<std::priority_queue<int, std::deque<int> >::value_type, int>::value), "");
+static_assert((std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), "");
+static_assert((std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), "");
+static_assert((std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), "");
+static_assert((std::is_same<std::priority_queue<int>::value_compare, std::less<int> >::value), "");
+static_assert((std::is_same<std::priority_queue<int, std::deque<int> >::value_compare, std::less<int> >::value), "");
+static_assert((std::is_same<std::priority_queue<int, std::deque<int>, std::greater<int> >::value_compare,
+                            std::greater<int> >::value),
+              "");
+static_assert((std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), "");
+static_assert((!std::uses_allocator<std::priority_queue<int, C>, std::allocator<int> >::value), "");

diff  --git a/libcxx/test/std/containers/container.adaptors/priority.queue/types.pass.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
deleted file mode 100644
index d90933925a73b..0000000000000
--- a/libcxx/test/std/containers/container.adaptors/priority.queue/types.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <queue>
-
-// template <class T, class Container = vector<T>,
-//           class Compare = less<typename Container::value_type>>
-// class priority_queue
-// {
-// public:
-//     typedef Container                                container_type;
-//     typedef Compare                                  value_compare; // LWG#2684
-//     typedef typename container_type::value_type      value_type;
-//     typedef typename container_type::reference       reference;
-//     typedef typename container_type::const_reference const_reference;
-//     typedef typename container_type::size_type       size_type;
-//
-// protected:
-//     container_type c;
-//     Compare comp;
-
-#include <queue>
-#include <cassert>
-#include <deque>
-#include <functional>
-#include <memory>
-#include <type_traits>
-#include <vector>
-
-#include "test_macros.h"
-
-struct test : private std::priority_queue<int> {
-  test() {
-    c.push_back(1);
-    assert(comp(1, 2));
-  }
-};
-
-struct C {
-  typedef int value_type;
-  typedef int& reference;
-  typedef const int& const_reference;
-  typedef int size_type;
-};
-
-int main(int, char**) {
-  static_assert((std::is_same<std::priority_queue<int>::container_type, std::vector<int> >::value), "");
-  static_assert(
-      (std::is_same<std::priority_queue<int, std::deque<int> >::container_type, std::deque<int> >::value), "");
-  static_assert((std::is_same<std::priority_queue<int, std::deque<int> >::value_type, int>::value), "");
-  static_assert((std::is_same<std::priority_queue<int>::reference, std::vector<int>::reference>::value), "");
-  static_assert(
-      (std::is_same<std::priority_queue<int>::const_reference, std::vector<int>::const_reference>::value), "");
-  static_assert((std::is_same<std::priority_queue<int>::size_type, std::vector<int>::size_type>::value), "");
-  static_assert((std::is_same<std::priority_queue<int>::value_compare, std::less<int> >::value), "");
-  static_assert((std::is_same<std::priority_queue<int, std::deque<int> >::value_compare, std::less<int> >::value), "");
-  static_assert((std::is_same<std::priority_queue<int, std::deque<int>, std::greater<int> >::value_compare,
-                              std::greater<int> >::value),
-                "");
-  static_assert((std::uses_allocator<std::priority_queue<int>, std::allocator<int> >::value), "");
-  static_assert((!std::uses_allocator<std::priority_queue<int, C>, std::allocator<int> >::value), "");
-  test t;
-
-  return 0;
-}

diff  --git a/libcxx/test/std/containers/sequences/array/types.pass.cpp b/libcxx/test/std/containers/sequences/array/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/array/types.pass.cpp
rename to libcxx/test/std/containers/sequences/array/types.compile.pass.cpp
index f216d3ed15849..86346ee09b9b1 100644
--- a/libcxx/test/std/containers/sequences/array/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/types.compile.pass.cpp
@@ -34,6 +34,7 @@ template <class C>
 void test_iterators() {
   typedef std::iterator_traits<typename C::iterator> ItT;
   typedef std::iterator_traits<typename C::const_iterator> CItT;
+
   static_assert((std::is_same<typename ItT::iterator_category, std::random_access_iterator_tag>::value), "");
   static_assert((std::is_same<typename ItT::value_type, typename C::value_type>::value), "");
   static_assert((std::is_same<typename ItT::reference, typename C::reference>::value), "");
@@ -47,10 +48,11 @@ void test_iterators() {
   static_assert((std::is_same<typename CItT::
diff erence_type, typename C::
diff erence_type>::value), "");
 }
 
-int main(int, char**) {
+void test() {
   {
     typedef double T;
     typedef std::array<T, 10> C;
+
     static_assert((std::is_same<C::reference, T&>::value), "");
     static_assert((std::is_same<C::const_reference, const T&>::value), "");
     test_iterators<C>();
@@ -73,6 +75,7 @@ int main(int, char**) {
   {
     typedef int* T;
     typedef std::array<T, 0> C;
+
     static_assert((std::is_same<C::reference, T&>::value), "");
     static_assert((std::is_same<C::const_reference, const T&>::value), "");
     test_iterators<C>();
@@ -92,6 +95,4 @@ int main(int, char**) {
                                 typename std::iterator_traits<typename C::const_iterator>::
diff erence_type>::value),
                   "");
   }
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/deque/types.pass.cpp b/libcxx/test/std/containers/sequences/deque/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/deque/types.pass.cpp
rename to libcxx/test/std/containers/sequences/deque/types.compile.pass.cpp
index 8184d55873d20..e735f3f1d40c4 100644
--- a/libcxx/test/std/containers/sequences/deque/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/types.compile.pass.cpp
@@ -77,7 +77,7 @@ void test() {
                 "");
 }
 
-int main(int, char**) {
+void test() {
   test<int, test_allocator<int> >();
   test<int*, std::allocator<int*> >();
   test<Copyable, test_allocator<Copyable> >();
@@ -106,6 +106,4 @@ int main(int, char**) {
                   "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
rename to libcxx/test/std/containers/sequences/forwardlist/types.compile.pass.cpp
index 58b73415f1a72..7b37db6a700ba 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/types.compile.pass.cpp
@@ -52,9 +52,10 @@ struct A {
   std::forward_list<A> v;
 }; // incomplete type support
 
-int main(int, char**) {
+void test() {
   {
     typedef std::forward_list<char> C;
+
     static_assert((std::is_same<C::value_type, char>::value), "");
     static_assert((std::is_same<C::allocator_type, std::allocator<char> >::value), "");
     static_assert((std::is_same<C::reference, char&>::value), "");
@@ -76,6 +77,7 @@ int main(int, char**) {
 #if TEST_STD_VER >= 11
   {
     typedef std::forward_list<char, min_allocator<char>> C;
+
     static_assert((std::is_same<C::value_type, char>::value), "");
     static_assert((std::is_same<C::allocator_type, min_allocator<char> >::value), "");
     static_assert((std::is_same<C::reference, char&>::value), "");
@@ -96,6 +98,4 @@ int main(int, char**) {
                   "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/list/types.pass.cpp b/libcxx/test/std/containers/sequences/list/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/list/types.pass.cpp
rename to libcxx/test/std/containers/sequences/list/types.compile.pass.cpp
index 7075f6eff0b2b..e640a0036f815 100644
--- a/libcxx/test/std/containers/sequences/list/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/types.compile.pass.cpp
@@ -49,9 +49,10 @@ struct A {
   std::list<A> v;
 }; // incomplete type support
 
-int main(int, char**) {
+void test() {
   {
     typedef std::list<int> C;
+
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
     static_assert((std::is_same<C::reference, std::allocator_traits<std::allocator<int> >::value_type&>::value), "");
@@ -70,10 +71,10 @@ int main(int, char**) {
                                 typename std::iterator_traits<typename C::const_iterator>::
diff erence_type>::value),
                   "");
   }
-
 #if TEST_STD_VER >= 11
   {
     typedef std::list<int, min_allocator<int>> C;
+
     static_assert((std::is_same<C::value_type, int>::value), "");
     static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
     static_assert((std::is_same<C::reference, int&>::value), "");
@@ -91,6 +92,4 @@ int main(int, char**) {
                   "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp
rename to libcxx/test/std/containers/sequences/vector.bool/types.compile.pass.cpp
index 4aaf02ef31f8b..a26004c47055e 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/types.compile.pass.cpp
@@ -72,13 +72,11 @@ void test() {
 #endif
 }
 
-int main(int, char**) {
+void test() {
   test<test_allocator<bool> >();
   test<std::allocator<bool> >();
   static_assert((std::is_same<std::vector<bool>::allocator_type, std::allocator<bool> >::value), "");
 #if TEST_STD_VER >= 11
   test<min_allocator<bool> >();
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/vector/types.pass.cpp b/libcxx/test/std/containers/sequences/vector/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/sequences/vector/types.pass.cpp
rename to libcxx/test/std/containers/sequences/vector/types.compile.pass.cpp
index c3aa60bd30c7e..cfdccde755916 100644
--- a/libcxx/test/std/containers/sequences/vector/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/types.compile.pass.cpp
@@ -84,7 +84,7 @@ void test() {
       "");
 }
 
-int main(int, char**) {
+void test() {
   test<int, test_allocator<int> >();
   test<int*, std::allocator<int*> >();
   test<Copyable, test_allocator<Copyable> >();
@@ -107,6 +107,4 @@ int main(int, char**) {
     //         typename std::iterator_traits<typename C::const_iterator>::
diff erence_type>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.map/types.pass.cpp b/libcxx/test/std/containers/unord/unord.map/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/unord/unord.map/types.pass.cpp
rename to libcxx/test/std/containers/unord/unord.map/types.compile.pass.cpp
index c883d35f85ee6..1328fac9977ec 100644
--- a/libcxx/test/std/containers/unord/unord.map/types.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/types.compile.pass.cpp
@@ -33,9 +33,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main(int, char**) {
+void test() {
   {
     typedef std::unordered_map<char, short> C;
+
     static_assert((std::is_same<C::key_type, char>::value), "");
     static_assert((std::is_same<C::mapped_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -54,6 +55,7 @@ int main(int, char**) {
     typedef std::
         unordered_map<char, short, std::hash<char>, std::equal_to<char>, min_allocator<std::pair<const char, short>>>
             C;
+
     static_assert((std::is_same<C::key_type, char>::value), "");
     static_assert((std::is_same<C::mapped_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -69,6 +71,4 @@ int main(int, char**) {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/types.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/unord/unord.multimap/types.pass.cpp
rename to libcxx/test/std/containers/unord/unord.multimap/types.compile.pass.cpp
index e9f5878646dc8..9c0786c50404e 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/types.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/types.compile.pass.cpp
@@ -33,9 +33,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main(int, char**) {
+void test() {
   {
     typedef std::unordered_multimap<char, short> C;
+
     static_assert((std::is_same<C::key_type, char>::value), "");
     static_assert((std::is_same<C::mapped_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -57,6 +58,7 @@ int main(int, char**) {
                                     std::equal_to<char>,
                                     min_allocator<std::pair<const char, short>>>
         C;
+
     static_assert((std::is_same<C::key_type, char>::value), "");
     static_assert((std::is_same<C::mapped_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -72,6 +74,4 @@ int main(int, char**) {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/types.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/unord/unord.multiset/types.pass.cpp
rename to libcxx/test/std/containers/unord/unord.multiset/types.compile.pass.cpp
index 4e5b0e0ce6981..e3383a0519d08 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/types.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/types.compile.pass.cpp
@@ -32,9 +32,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main(int, char**) {
+void test() {
   {
     typedef std::unordered_multiset<short> C;
+
     static_assert((std::is_same<C::value_type, short>::value), "");
     static_assert((std::is_same<C::key_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -50,6 +51,7 @@ int main(int, char**) {
 #if TEST_STD_VER >= 11
   {
     typedef std::unordered_multiset<short, std::hash<short>, std::equal_to<short>, min_allocator<short>> C;
+
     static_assert((std::is_same<C::value_type, short>::value), "");
     static_assert((std::is_same<C::key_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -64,6 +66,4 @@ int main(int, char**) {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.set/types.pass.cpp b/libcxx/test/std/containers/unord/unord.set/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/unord/unord.set/types.pass.cpp
rename to libcxx/test/std/containers/unord/unord.set/types.compile.pass.cpp
index 623da69aba239..889b59a568132 100644
--- a/libcxx/test/std/containers/unord/unord.set/types.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/types.compile.pass.cpp
@@ -32,9 +32,10 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main(int, char**) {
+void test() {
   {
     typedef std::unordered_set<short> C;
+
     static_assert((std::is_same<C::value_type, short>::value), "");
     static_assert((std::is_same<C::key_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -50,6 +51,7 @@ int main(int, char**) {
 #if TEST_STD_VER >= 11
   {
     typedef std::unordered_set<short, std::hash<short>, std::equal_to<short>, min_allocator<short>> C;
+
     static_assert((std::is_same<C::value_type, short>::value), "");
     static_assert((std::is_same<C::key_type, short>::value), "");
     static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
@@ -64,6 +66,4 @@ int main(int, char**) {
     static_assert((std::is_same<C::
diff erence_type, std::ptr
diff _t>::value), "");
   }
 #endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/views/mdspan/mdspan/types.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/types.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/containers/views/mdspan/mdspan/types.pass.cpp
rename to libcxx/test/std/containers/views/mdspan/mdspan/types.compile.pass.cpp
index b576419828b71..ea26c6388e617 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/types.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/types.compile.pass.cpp
@@ -158,7 +158,7 @@ void mixin_accessor() {
   mixin_layout<T, checked_accessor<T>>();
 }
 
-int main(int, char**) {
+void test() {
   mixin_accessor<int>();
   mixin_accessor<const int>();
   mixin_accessor<double>();
@@ -176,5 +176,4 @@ int main(int, char**) {
                    true,
                    true,
                    true>();
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/views/views.span/types.pass.cpp b/libcxx/test/std/containers/views/views.span/types.compile.pass.cpp
similarity index 98%
rename from libcxx/test/std/containers/views/views.span/types.pass.cpp
rename to libcxx/test/std/containers/views/views.span/types.compile.pass.cpp
index 22e19761122ba..aaf14f85ba7ad 100644
--- a/libcxx/test/std/containers/views/views.span/types.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/types.compile.pass.cpp
@@ -75,12 +75,10 @@ void test() {
 
 struct A {};
 
-int main(int, char**) {
+void test() {
   test<int>();
   test<long>();
   test<double>();
   test<std::string>();
   test<A>();
-
-  return 0;
 }


        


More information about the libcxx-commits mailing list