1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 |
10 | |
11 | // <mdspan> |
12 | |
13 | // template<class Extents> |
14 | // class layout_stride::mapping; |
15 | |
16 | // If Extents is not a specialization of extents, then the program is |
17 | // ill-formed. |
18 | |
19 | // Mandates: If Extents::rank_dynamic() == 0 is true, then the size of the |
20 | // multidimensional index space Extents() is representable as a value of type |
21 | // typename Extents::index_type. |
22 | |
23 | #include <mdspan> |
24 | |
25 | void not_extents() { |
26 | // expected-error-re@*:* {{static assertion failed {{.*}}layout_stride::mapping template argument must be a specialization of extents}} |
27 | [[maybe_unused]] std::layout_stride::mapping<void> mapping; |
28 | } |
29 | |
30 | void representable() { |
31 | // expected-error-re@*:* {{static assertion failed {{.*}}layout_stride::mapping product of static extents must be representable as index_type.}} |
32 | [[maybe_unused]] std::layout_stride::mapping<std::extents<signed char, 20, 20>> mapping; |
33 | } |
34 | |