[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:57:05 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Stephan T. Lavavej (StephanTLavavej)

<details>
<summary>Changes</summary>

This is a pure syntax cleanup, I don't need it for running libc++'s tests with MSVC's STL.

This is possible because `std::layout_meow` and `layout_wrapping_integral<1729>` aren't dependent types. We only need `typename` and `template` when reaching *into* a dependent type, like `typename OtherLayout::template mapping<E2>` or `typename layout_wrapping_integral<Wraps>::template mapping<Extents>`.

* Drop unnecessary `typename` and `template` disambiguators for `std::layout_meow::mapping`.
  + This is a pure regex replacement from `(?:typename )?std::layout_(left|right|stride)::template mapping` to `std::layout_$1::mapping`.
* Similarly for `layout_wrapping_integral`.
  + This is a pure regex replacement from `(?:typename )?(layout_wrapping_integral<\d+>)::template mapping` to `$1::mapping`.


---

Patch is 58.62 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/74571.diff


43 Files Affected:

- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp (+6-6) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp (+6-6) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.conversion.pass.cpp (+4-4) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp (+4-4) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp (+4-4) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp (+4-4) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.pass.cpp (+4-4) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.index_operator.pass.cpp (+6-6) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.stride.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp (+1-1) 
- (modified) libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_left/ctor.layout_right.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_left/ctor.layout_stride.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_left/ctor.mapping.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_left/properties.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_right/ctor.layout_left.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_right/ctor.layout_stride.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_right/ctor.mapping.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_right/properties.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_stride/comparison.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_stride/ctor.strided_mapping.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp (+8-8) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_stride/is_exhaustive_corner_case.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/layout_stride/properties.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/assign.pass.cpp (+4-4) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.copy.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.default.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp (+4-4) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp (+4-4) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_integers.pass.cpp (+4-4) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map_acc.pass.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp (+4-4) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/ctor.move.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/mapping.verify.cpp (+1-1) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/move.pass.cpp (+2-2) 
- (modified) libcxx/test/std/containers/views/mdspan/mdspan/swap.pass.cpp (+1-1) 


``````````diff
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
index 44e11d6258977..94d49f13e9b8a 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
@@ -52,7 +52,7 @@ int main(int, char**) {
     [[maybe_unused]] std::extents<char, D, 5> e(arg_exts);
     // but the product is not, so we can't use it for layout_left
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_left::template mapping<std::extents<char, D, 5>> m(arg); }()),
+        ([=] { std::layout_left::mapping<std::extents<char, D, 5>> m(arg); }()),
         "layout_left::mapping converting ctor: other.required_span_size() must be representable as index_type.");
   }
   return 0;
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
index a225a323d1255..e73a167a51be3 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
@@ -32,7 +32,7 @@ int main(int, char**) {
   {
     // the extents are representable but the product is not, so we can't use it for layout_left
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_left::template mapping<std::extents<char, D, 5>> m(std::extents<char, D, 5>(100)); }()),
+        ([=] { std::layout_left::mapping<std::extents<char, D, 5>> m(std::extents<char, D, 5>(100)); }()),
         "layout_left::mapping extents ctor: product of extents must be representable as index_type.");
   }
   return 0;
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
index 6718c231877bc..c514a532a1a0d 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
@@ -31,35 +31,35 @@
 int main(int, char**) {
   // value out of range
   {
-    std::layout_left::template mapping<std::extents<unsigned char, 5>> m;
+    std::layout_left::mapping<std::extents<unsigned char, 5>> m;
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_left::mapping: out of bounds indexing");
   }
   {
-    std::layout_left::template mapping<std::extents<signed char, 5>> m;
+    std::layout_left::mapping<std::extents<signed char, 5>> m;
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_left::mapping: out of bounds indexing");
   }
   {
-    std::layout_left::template mapping<std::dextents<unsigned char, 1>> m(std::dextents<unsigned char, 1>(5));
+    std::layout_left::mapping<std::dextents<unsigned char, 1>> m(std::dextents<unsigned char, 1>(5));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_left::mapping: out of bounds indexing");
   }
   {
-    std::layout_left::template mapping<std::dextents<signed char, 1>> m(std::dextents<signed char, 1>(5));
+    std::layout_left::mapping<std::dextents<signed char, 1>> m(std::dextents<signed char, 1>(5));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_left::mapping: out of bounds indexing");
   }
   {
-    std::layout_left::template mapping<std::dextents<int, 3>> m(std::dextents<int, 3>(5, 7, 9));
+    std::layout_left::mapping<std::dextents<int, 3>> m(std::dextents<int, 3>(5, 7, 9));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, -1, -1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, 0, 0), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(0, -1, 0), "layout_left::mapping: out of bounds indexing");
@@ -70,7 +70,7 @@ int main(int, char**) {
     TEST_LIBCPP_ASSERT_FAILURE(m(5, 7, 9), "layout_left::mapping: out of bounds indexing");
   }
   {
-    std::layout_left::template mapping<std::dextents<unsigned, 3>> m(std::dextents<int, 3>(5, 7, 9));
+    std::layout_left::mapping<std::dextents<unsigned, 3>> m(std::dextents<int, 3>(5, 7, 9));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, -1, -1), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, 0, 0), "layout_left::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(0, -1, 0), "layout_left::mapping: out of bounds indexing");
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp
index e06ec0c4fc42e..96af460d695db 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp
@@ -33,7 +33,7 @@
 int main(int, char**) {
   // value out of range
   {
-    std::layout_left::template mapping<std::dextents<int, 3>> m{std::dextents<int, 3>{100, 100, 100}};
+    std::layout_left::mapping<std::dextents<int, 3>> m{std::dextents<int, 3>{100, 100, 100}};
 
     TEST_LIBCPP_ASSERT_FAILURE(m.stride(4), "invalid rank index");
   }
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
index 2d877a50781b8..f3ee1a63be368 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
@@ -52,7 +52,7 @@ int main(int, char**) {
     [[maybe_unused]] std::extents<char, D, 5> e(arg_exts);
     // but the product is not, so we can't use it for layout_right
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_right::template mapping<std::extents<char, D, 5>> m(arg); }()),
+        ([=] { std::layout_right::mapping<std::extents<char, D, 5>> m(arg); }()),
         "layout_right::mapping converting ctor: other.required_span_size() must be representable as index_type.");
   }
   return 0;
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
index 83fb320edf2cf..824c0b0f5793b 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
@@ -31,7 +31,7 @@ int main(int, char**) {
   {
     // the extents are representable but the product is not, so we can't use it for layout_right
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_right::template mapping<std::extents<char, D, 5>> m(std::extents<char, D, 5>(100)); }()),
+        ([=] { std::layout_right::mapping<std::extents<char, D, 5>> m(std::extents<char, D, 5>(100)); }()),
         "layout_right::mapping extents ctor: product of extents must be representable as index_type.");
   }
   return 0;
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
index fa7eb4a54758f..756234f157f2c 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
@@ -31,35 +31,35 @@
 int main(int, char**) {
   // value out of range
   {
-    std::layout_right::template mapping<std::extents<unsigned char, 5>> m;
+    std::layout_right::mapping<std::extents<unsigned char, 5>> m;
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_right::mapping: out of bounds indexing");
   }
   {
-    std::layout_right::template mapping<std::extents<signed char, 5>> m;
+    std::layout_right::mapping<std::extents<signed char, 5>> m;
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_right::mapping: out of bounds indexing");
   }
   {
-    std::layout_right::template mapping<std::dextents<unsigned char, 1>> m(std::dextents<unsigned char, 1>(5));
+    std::layout_right::mapping<std::dextents<unsigned char, 1>> m(std::dextents<unsigned char, 1>(5));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_right::mapping: out of bounds indexing");
   }
   {
-    std::layout_right::template mapping<std::dextents<signed char, 1>> m(std::dextents<signed char, 1>(5));
+    std::layout_right::mapping<std::dextents<signed char, 1>> m(std::dextents<signed char, 1>(5));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-130), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(5), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(1000), "layout_right::mapping: out of bounds indexing");
   }
   {
-    std::layout_right::template mapping<std::dextents<int, 3>> m(std::dextents<int, 3>(5, 7, 9));
+    std::layout_right::mapping<std::dextents<int, 3>> m(std::dextents<int, 3>(5, 7, 9));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, -1, -1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, 0, 0), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(0, -1, 0), "layout_right::mapping: out of bounds indexing");
@@ -70,7 +70,7 @@ int main(int, char**) {
     TEST_LIBCPP_ASSERT_FAILURE(m(5, 7, 9), "layout_right::mapping: out of bounds indexing");
   }
   {
-    std::layout_right::template mapping<std::dextents<unsigned, 3>> m(std::dextents<int, 3>(5, 7, 9));
+    std::layout_right::mapping<std::dextents<unsigned, 3>> m(std::dextents<int, 3>(5, 7, 9));
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, -1, -1), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(-1, 0, 0), "layout_right::mapping: out of bounds indexing");
     TEST_LIBCPP_ASSERT_FAILURE(m(0, -1, 0), "layout_right::mapping: out of bounds indexing");
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp
index 95179cdc31aca..fe5376b480c08 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp
@@ -33,7 +33,7 @@
 int main(int, char**) {
   // value out of range
   {
-    std::layout_right::template mapping<std::dextents<int, 3>> m{std::dextents<int, 3>{100, 100, 100}};
+    std::layout_right::mapping<std::dextents<int, 3>> m{std::dextents<int, 3>{100, 100, 100}};
 
     TEST_LIBCPP_ASSERT_FAILURE(m.stride(4), "invalid rank index");
   }
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 d696206021e29..a6b8f928b514f 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
@@ -74,7 +74,7 @@ int main(int, char**) {
   {
     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::template mapping<std::extents<char, D, D>> m(offset_map); }()),
+        ([=] { 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
@@ -85,7 +85,7 @@ int main(int, char**) {
     [[maybe_unused]] std::extents<char, D, 5> e(arg_exts);
     // but the product is not, so we can't use it for layout_stride
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_stride::template mapping<std::extents<char, D, 5>> m(arg); }()),
+        ([=] { std::layout_stride::mapping<std::extents<char, D, 5>> m(arg); }()),
         "layout_stride::mapping converting ctor: other.required_span_size() must be representable as index_type.");
   }
   // required_span_size not representable, while individual extents are, edge case
@@ -99,14 +99,14 @@ int main(int, char**) {
     [[maybe_unused]] std::extents<signed char, D, 10> e(arg_exts);
     // but the product is not, so we can't use it for layout_stride
     TEST_LIBCPP_ASSERT_FAILURE(
-        ([=] { std::layout_stride::template mapping<std::extents<signed char, D, 10>> m(arg); }()),
+        ([=] { std::layout_stride::mapping<std::extents<signed char, D, 10>> m(arg); }()),
         "layout_stride::mapping converting ctor: other.required_span_size() must be representable as index_type.");
   }
   // 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::template mapping<std::extents<char, D, D>> m(offset_map); }()),
+        ([=] { 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_array.non_unique.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp
index ba1c81d35d8df..34b333ec3d145 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.non_unique.pass.cpp
@@ -42,7 +42,7 @@ int main(int, char**) {
   {
     TEST_LIBCPP_ASSERT_FAILURE(
         ([=] {
-          std::layout_stride::template mapping<std::extents<unsigned, D, 5, 7>> m(
+          std::layout_stride::mapping<std::extents<unsigned, D, 5, 7>> m(
               std::extents<unsigned, D, 5, 7>(20), std::array<unsigned, 3>{4, 1, 200});
         }()),
         "layout_stride::mapping ctor: the provided extents and strides lead to a non-unique mapping");
@@ -50,15 +50,15 @@ int main(int, char**) {
   // equal strides
   {
     // should work because one of the equal strides is associated with an extent of 1
-    [[maybe_unused]] std::layout_stride::template mapping<std::extents<unsigned, D, 5, 1>> m1(
+    [[maybe_unused]] std::layout_stride::mapping<std::extents<unsigned, D, 5, 1>> m1(
         std::extents<unsigned, D, 5, 1>(2), std::array<unsigned, 3>{5, 1, 5});
-    [[maybe_unused]] std::layout_stride::template mapping<std::extents<unsigned, D, 5, 2>> m2(
+    [[maybe_unused]] std::layout_stride::mapping<std::extents<unsigned, D, 5, 2>> m2(
         std::extents<unsigned, D, 5, 2>(1), std::array<unsigned, 3>{5, 1, 5});
 
     // will fail because neither of the equal strides is associated with an extent of 1
     TEST_LIBCPP_ASSERT_FAILURE(
         ([=] {
-          std::layout_stride::template mapping<std::extents<unsigned, D, 5, 2>> m3(
+          std::layout_stride::mapping<std::extents<unsigned, D, 5, 2>> m3(
               std::extents<unsigned, D, 5, 2>(2), std::array<unsigned, 3>{5, 1, 5});
         }()),
         "layout_stride::mapping ctor: the provided extents and strides lead to a non-unique mapping");
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
index c7a7febd09044..eab1c67ed6979 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_array.pass.cpp
@@ -41,7 +41,7 @@ int main(int, char**) {
   // the extents are representable but the product with strides is not, so we can't use it for layout_stride
   TEST_LIBCPP_ASSERT_FAILURE(
       ([=] {
-        std::layout_stride::template mapping<std::extents<char, D, 5>> m(
+        std::layout_stride::mapping<std::extents<char, D, 5>> m(
             std::extents<char, D, 5>(20), std::array<int, 2>{20, 1});
       }()),
       "layout_stride::mapping ctor: required span size is not representable as index_type.");
@@ -50,7 +50,7 @@ int main(int, char**) {
   static_assert(static_cast<unsigned char>(257u) == 1);
   TEST_LIBCPP_ASSERT_FAILURE(
       ([=] {
-        std::layout_stride::template mapping<std::extents<unsigned char, D, 5>> m(
+        std::layout_stride::mapping<std::extents<unsigned char, D, 5>> m(
             std::extents<unsigned char, D, 5>(20), std::array<unsigned, 2>{257, 1});
       }()),
       "layout_stride::mapping ctor: required span size is not representable as index_type.");
@@ -58,14 +58,14 @@ int main(int, char**) {
   // negative strides are not allowed, check with unsigned index_type so we make sure we catch that
   TEST_LIBCPP_ASSERT_FAILURE(
       ([=] {
-        std::layout_stride::template mapping<std::extents<unsigned, D, 5>> m(
+        std::layout_stride::mapping<std::extents<unsigned, D, 5>> m(
             std::extents<unsigned, D, 5>(20), std::array<int, 2>{20, -1});
       }()),
       "layout_stride::mapping ctor: all strides must be greater than 0");
   // zero strides are not allowed, check with unsigned index_type so we make sure we catch that
   TEST_LIBCPP_ASSERT_FAILURE(
       ([=] {
-        std::layout_stride::template mapping<std::extents<unsigned, D, 5>> m(
+        std::layout_stride::mapping<std::extents<unsigned, D, 5>> m(
             std::extents<unsigned, D, 5>(20), std::array<unsigned, 2>{20, 0});
       }()),
       "layout_stride::mapping ctor: all strides must be greater than 0");
diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp
index b20f657624074..9e1de537682d8 100644
--- a/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp
+++ b/libcxx/test/libcxx/containers/views/mdspan/layout_stride/assert.ctor.extents_span.non_unique.pass.cpp
@@ -43,7 +43,7 @@ int main(int, char**) {
     TEST_LIBCPP_ASSERT_FAILURE(
         ([=] {
           std::array<unsigned, 3> strides{4, 1, 200};
-          std::layo...
[truncated]

``````````

</details>


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


More information about the libcxx-commits mailing list