Skip to content

Commit 20a6b63

Browse files
[libcxx] Include __fwd/span.h in <mdspan>
This patch includes __fwd/span.h in <mdspan> so that we get the declaration of dynamic_extent inside <mdspan>. We also clean up quite a few tests that were manually included <span> for dynamic_extent. This is based on feedback from #142693. Reviewers: philnik777, ldionne Reviewed By: philnik777 Pull Request: #142925
1 parent 9ee4b35 commit 20a6b63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6
-56
lines changed

libcxx/include/mdspan

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,12 @@ namespace std {
450450
# include <__config>
451451

452452
# if _LIBCPP_STD_VER >= 23
453-
# include <__fwd/mdspan.h>
453+
# include <__fwd/mdspan.h> // TODO(boomanaiden154): This is currently a
454+
// non-standard extension to include
455+
// std::dynamic_extent tracked by LWG issue 4275.
456+
// This comment should be deleted or the include
457+
// deleted upon resolution.
458+
# include <__fwd/span.h>
454459
# include <__mdspan/default_accessor.h>
455460
# include <__mdspan/extents.h>
456461
# include <__mdspan/layout_left.h>

libcxx/test/std/containers/views/mdspan/CustomTestLayouts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <cstddef>
2626
#include <limits>
2727
#include <mdspan>
28-
#include <span> // dynamic_extent
2928
#include <type_traits>
3029
#include <utility>
3130

libcxx/test/std/containers/views/mdspan/extents/comparison.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <cassert>
2121
#include <cstddef>
2222
#include <mdspan>
23-
#include <span> // dynamic_extent
2423

2524
#include "test_macros.h"
2625

libcxx/test/std/containers/views/mdspan/extents/conversion.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <cstddef>
3333
#include <limits>
3434
#include <mdspan>
35-
#include <span> // dynamic_extent
3635
#include <type_traits>
3736

3837
template <class To, class From>

libcxx/test/std/containers/views/mdspan/extents/ctad.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <cassert>
2020
#include <cstddef>
2121
#include <mdspan>
22-
#include <span> // dynamic_extent
2322
#include <type_traits>
2423

2524
#include "../ConvertibleToIntegral.h"

libcxx/test/std/containers/views/mdspan/extents/dextents.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <mdspan>
2020
#include <cstddef>
21-
#include <span> // dynamic_extent
2221

2322
#include "test_macros.h"
2423

libcxx/test/std/containers/views/mdspan/extents/dims.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <mdspan>
2020
#include <cstddef>
21-
#include <span> // dynamic_extent
2221

2322
#include "test_macros.h"
2423

libcxx/test/std/containers/views/mdspan/extents/index_type.verify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <cstddef>
2020
#include <climits>
2121
#include <mdspan>
22-
#include <span> // dynamic_extent
2322

2423
void invalid_index_types() {
2524
// expected-error@*:* {{static assertion failed: extents::index_type must be a signed or unsigned integer type}}

libcxx/test/std/containers/views/mdspan/extents/obs_static.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <cassert>
3030
#include <cstddef>
3131
#include <mdspan>
32-
#include <span> // dynamic_extent
3332
#include <utility>
3433

3534
#include "test_macros.h"

libcxx/test/std/containers/views/mdspan/extents/types.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <concepts>
2727
#include <cstddef>
2828
#include <mdspan>
29-
#include <span> // dynamic_extent
3029
#include <type_traits>
3130

3231
#include "test_macros.h"

0 commit comments

Comments
 (0)