| 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, c++23 |
| 10 | |
| 11 | // REQUIRES: has-unix-headers |
| 12 | // REQUIRES: libcpp-hardening-mode={{extensive|debug}} |
| 13 | // XFAIL: availability-verbose_abort-missing |
| 14 | |
| 15 | // <span> |
| 16 | |
| 17 | // constexpr explicit(extent != dynamic_extent) span(std::initializer_list<value_type> il); // Since C++26 |
| 18 | |
| 19 | #include <cassert> |
| 20 | #include <initializer_list> |
| 21 | #include <span> |
| 22 | |
| 23 | #include "check_assertion.h" |
| 24 | |
| 25 | int main(int, char**) { |
| 26 | TEST_LIBCPP_ASSERT_FAILURE( |
| 27 | (std::span<const int, 4>({1, 2, 3, 9084, 5})), "Size mismatch in span's constructor _Extent != __il.size()." ); |
| 28 | TEST_LIBCPP_ASSERT_FAILURE((std::span<const int, 4>(std::initializer_list<int>{1, 2, 3, 9084, 5})), |
| 29 | "Size mismatch in span's constructor _Extent != __il.size()." ); |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |