[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: https://github.com/llvm/llvm-project/pull/142925
This commit is contained in:
Aiden Grossman
2025-06-08 21:58:36 +00:00
committed by GitHub
parent 9ee4b356fd
commit 20a6b63f1b
56 changed files with 6 additions and 56 deletions

View File

@@ -450,7 +450,12 @@ namespace std {
# include <__config>
# if _LIBCPP_STD_VER >= 23
# include <__fwd/mdspan.h>
# include <__fwd/mdspan.h> // TODO(boomanaiden154): This is currently a
// non-standard extension to include
// std::dynamic_extent tracked by LWG issue 4275.
// This comment should be deleted or the include
// deleted upon resolution.
# include <__fwd/span.h>
# include <__mdspan/default_accessor.h>
# include <__mdspan/extents.h>
# include <__mdspan/layout_left.h>

View File

@@ -25,7 +25,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include <utility>

View File

@@ -20,7 +20,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -32,7 +32,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
template <class To, class From>

View File

@@ -19,7 +19,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "../ConvertibleToIntegral.h"

View File

@@ -18,7 +18,6 @@
#include <mdspan>
#include <cstddef>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <mdspan>
#include <cstddef>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -19,7 +19,6 @@
#include <cstddef>
#include <climits>
#include <mdspan>
#include <span> // dynamic_extent
void invalid_index_types() {
// expected-error@*:* {{static assertion failed: extents::index_type must be a signed or unsigned integer type}}

View File

@@ -29,7 +29,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <utility>
#include "test_macros.h"

View File

@@ -26,7 +26,6 @@
#include <concepts>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -21,7 +21,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -27,7 +27,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -22,7 +22,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -27,7 +27,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -29,7 +29,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <utility>
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -79,7 +79,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include <utility>

View File

@@ -23,7 +23,6 @@
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -21,7 +21,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -27,7 +27,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -22,7 +22,6 @@
#include <cstddef>
#include <limits>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -27,7 +27,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -29,7 +29,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <utility>
#include "test_macros.h"

View File

@@ -18,7 +18,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -79,7 +79,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include <utility>

View File

@@ -23,7 +23,6 @@
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -25,7 +25,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -32,7 +32,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -38,7 +38,6 @@
#include <mdspan>
#include <cassert>
#include <limits>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -27,7 +27,6 @@
#include <array>
#include <cassert>
#include <cstdint>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -23,7 +23,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
template <class E>
constexpr void

View File

@@ -43,7 +43,6 @@
#include <concepts>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <cstddef>
#include <cstdint>
#include <mdspan>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -79,7 +79,6 @@
#include <cassert>
#include <cstddef>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include <utility>

View File

@@ -23,7 +23,6 @@
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <span> // dynamic_extent
#include "test_macros.h"

View File

@@ -14,7 +14,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -41,7 +41,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -16,7 +16,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -32,7 +32,6 @@
#include <cassert>
#include <concepts>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -26,7 +26,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -33,7 +33,6 @@
#include <cassert>
#include <concepts>
#include <mdspan>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -24,7 +24,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -21,7 +21,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -16,7 +16,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -16,7 +16,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -54,7 +54,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -19,7 +19,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"

View File

@@ -30,7 +30,6 @@
#include <mdspan>
#include <cassert>
#include <concepts>
#include <span> // dynamic_extent
#include <type_traits>
#include "test_macros.h"