[libcxx-commits] [libcxx] [libc++][test] Drop unnecessary `typename` and `template` for `layout_meow::mapping` (PR #74571)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 5 23:58:53 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 114325b86a3d0360afc772c44335fc9092686f58 40e7ba01b9b9012ad08de2a94450c622079ac5b6 -- libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp libcxx/test/std/containers/views/mdspan/layout_left/ctor.layout_right.pass.cpp libcxx/test/std/containers/views/mdspan/layout_left/ctor.layout_stride.pass.cpp libcxx/test/std/containers/views/mdspan/layout_left/ctor.mapping.pass.cpp libcxx/test/std/containers/views/mdspan/layout_left/properties.pass.cpp libcxx/test/std/containers/views/mdspan/layout_right/ctor.layout_left.pass.cpp libcxx/test/std/containers/views/mdspan/layout_right/ctor.layout_stride.pass.cpp libcxx/test/std/containers/views/mdspan/layout_right/ctor.mapping.pass.cpp libcxx/test/std/containers/views/mdspan/layout_right/properties.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/comparison.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/ctor.strided_mapping.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/is_exhaustive_corner_case.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/properties.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map_acc.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/mapping.verify.cpp libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/swap.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp
index a6b8f928b5..c6d3e4fe97 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp
@@ -73,9 +73,8 @@ int main(int, char**) {
   // all strides must be larger than zero
   {
     always_convertible_layout::mapping<std::dextents<int, 2>> offset_map(std::dextents<int, 2>{10, 10}, 100, -1);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_stride::mapping<std::extents<char, D, D>> m(offset_map); }()),
-        "layout_stride::mapping converting ctor: all strides must be greater than 0");
+    TEST_LIBCPP_ASSERT_FAILURE(([=] { std::layout_stride::mapping<std::extents<char, D, D>> m(offset_map); }()),
+                               "layout_stride::mapping converting ctor: all strides must be greater than 0");
   }
   // required_span_size not representable, while individual extents are
   {
@@ -105,9 +104,8 @@ int main(int, char**) {
   // base offset must be 0 (i.e. mapping(0,...,0)==0) for a strided layout with positive strides
   {
     always_convertible_layout::mapping<std::dextents<int, 2>> offset_map(std::dextents<int, 2>{10, 10}, 3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_stride::mapping<std::extents<char, D, D>> m(offset_map); }()),
-        "layout_stride::mapping converting ctor: base offset of mapping must be zero.");
+    TEST_LIBCPP_ASSERT_FAILURE(([=] { std::layout_stride::mapping<std::extents<char, D, D>> m(offset_map); }()),
+                               "layout_stride::mapping converting ctor: base offset of mapping must be zero.");
   }
   return 0;
 }
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
index d6766f2c36..3b7338449a 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp
@@ -44,8 +44,7 @@ int main(int, char**) {
     TEST_LIBCPP_ASSERT_FAILURE(
         ([=] {
           std::array<int, 2> strides{20, 1};
-          std::layout_stride::mapping<std::extents<char, D, 5>> m(
-              std::extents<char, D, 5>(20), std::span(strides));
+          std::layout_stride::mapping<std::extents<char, D, 5>> m(std::extents<char, D, 5>(20), std::span(strides));
         }()),
         "layout_stride::mapping ctor: required span size is not representable as index_type.");
 
diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp
index 78490e5e96..ee3114e228 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp
@@ -30,14 +30,14 @@ int main(int, char**) {
   // make sure we are not failing because of using index_type instead of size_type
   {
     layout_wrapping_integral<4>::mapping<std::dextents<char, 2>> map(
-      std::dextents<char, 2>(100, 2), not_extents_constructible_tag());
+        std::dextents<char, 2>(100, 2), not_extents_constructible_tag());
     std::mdspan<float, std::dextents<char, 2>, layout_wrapping_integral<4>> mds(data.data(), map);
     assert(map.required_span_size() == char(8));
     assert((static_cast<unsigned char>(200) == mds.size()));
   }
   {
     layout_wrapping_integral<4>::mapping<std::dextents<char, 2>> map(
-      std::dextents<char, 2>(100, 3), not_extents_constructible_tag());
+        std::dextents<char, 2>(100, 3), not_extents_constructible_tag());
     std::mdspan<float, std::dextents<char, 2>, layout_wrapping_integral<4>> mds(data.data(), map);
     // sanity check
     assert(map.required_span_size() == char(12));
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp
index 67c60caee0..9e128f5180 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp
@@ -72,9 +72,8 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents(handle, std::layout_left(), acc);
   mixin_extents(handle, std::layout_right(), acc);
   // make sure we test a not trivially assignable mapping
-  static_assert(!std::is_trivially_assignable_v<
-                layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                const layout_wrapping_integral<4>::mapping<std::extents<int>>&>);
+  static_assert(!std::is_trivially_assignable_v< layout_wrapping_integral<4>::mapping<std::extents<int>>,
+                                                 const layout_wrapping_integral<4>::mapping<std::extents<int>>&>);
   mixin_extents(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp
index 2d7b0643b6..6d88e9ff02 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp
@@ -61,8 +61,7 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents(handle, std::layout_left(), acc);
   mixin_extents(handle, std::layout_right(), acc);
   // make sure we test a not trivially copyable mapping
-  static_assert(
-      !std::is_trivially_copyable_v<layout_wrapping_integral<4>::mapping<std::extents<int>>>);
+  static_assert(!std::is_trivially_copyable_v<layout_wrapping_integral<4>::mapping<std::extents<int>>>);
   mixin_extents(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp
index 41f6782324..dbb2ad8b41 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp
@@ -74,8 +74,7 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
 
   // Use weird layout, make sure it has the properties we want to test
   constexpr size_t D = std::dynamic_extent;
-  static_assert(!std::is_default_constructible_v<
-                layout_wrapping_integral<4>::mapping<std::extents<signed char, D>>>);
+  static_assert(!std::is_default_constructible_v< layout_wrapping_integral<4>::mapping<std::extents<signed char, D>>>);
   mixin_extents<hc, false, ac>(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp
index d775172f23..bbf8137a7c 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp
@@ -119,16 +119,14 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents<true, ac>(handle, std::layout_right(), acc);
 
   // Sanity check that this layouts mapping is constructible from extents (via its move constructor)
-  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                        std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<true, ac>(handle, layout_wrapping_integral<8>(), acc);
   // Sanity check that this layouts mapping is not constructible from extents
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<false, ac>(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp
index 17ac0c6458..0a8918028d 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp
@@ -83,16 +83,14 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
 
   // Use weird layout, make sure it has the properties we want to test
   // Sanity check that this layouts mapping is constructible from extents (via its move constructor)
-  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                        std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<false, ac>(handle, layout_wrapping_integral<8>(), acc);
   // Sanity check that this layouts mapping is not constructible from extents
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<false, ac>(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp
index b24cd552bc..c2e8d26cd8 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp
@@ -106,16 +106,14 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
 
   // Use weird layout, make sure it has the properties we want to test
   // Sanity check that this layouts mapping is constructible from extents (via its move constructor)
-  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                        std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<true, ac>(handle, layout_wrapping_integral<8>(), acc);
   // Sanity check that this layouts mapping is not constructible from extents
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<false, ac>(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp
index 98ad9e1b3a..980619795b 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp
@@ -119,16 +119,14 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents<true, ac>(handle, std::layout_right(), acc);
 
   // Sanity check that this layouts mapping is constructible from extents (via its move constructor)
-  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                        std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<8>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<true, ac>(handle, layout_wrapping_integral<8>(), acc);
   // Sanity check that this layouts mapping is not constructible from extents
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         std::extents<int>>);
-  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>,
-                                         const std::extents<int>&>);
+  static_assert(!std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, std::extents<int>>);
+  static_assert(
+      !std::is_constructible_v<layout_wrapping_integral<4>::mapping<std::extents<int>>, const std::extents<int>&>);
   mixin_extents<false, ac>(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp
index e3193916b4..c843c60335 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp
@@ -60,8 +60,7 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents(handle, std::layout_left(), acc);
   mixin_extents(handle, std::layout_right(), acc);
   // make sure we test a not trivially copyable mapping
-  static_assert(!std::is_trivially_move_constructible_v<
-                layout_wrapping_integral<4>::mapping<std::extents<int>>>);
+  static_assert(!std::is_trivially_move_constructible_v< layout_wrapping_integral<4>::mapping<std::extents<int>>>);
   mixin_extents(handle, layout_wrapping_integral<4>(), acc);
 }
 
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp
index db4c2f321a..9e1805431c 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp
@@ -63,8 +63,7 @@ constexpr void mixin_layout(const H& handle, const A& acc) {
   mixin_extents(handle, std::layout_left(), acc);
   mixin_extents(handle, std::layout_right(), acc);
   // make sure we test a not trivially copyable mapping
-  static_assert(
-      !std::is_trivially_move_assignable_v<layout_wrapping_integral<4>::mapping<std::extents<int>>>);
+  static_assert(!std::is_trivially_move_assignable_v<layout_wrapping_integral<4>::mapping<std::extents<int>>>);
   mixin_extents(handle, layout_wrapping_integral<4>(), acc);
 }
 

``````````

</details>


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


More information about the libcxx-commits mailing list