[PassBuilder] VectorizerEnd Extension Points (#123494)
[llvm-project.git] / libcxx / test / std / containers / views / mdspan / layout_stride / extents.verify.cpp
blob0c2ec888ab35bc9e6e71d01ff25c9e2f69b07c18
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
11 // <mdspan>
13 // template<class Extents>
14 // class layout_stride::mapping;
16 // If Extents is not a specialization of extents, then the program is
17 // ill-formed.
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.
23 #include <mdspan>
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;
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;