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