//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // // template // constexpr span first() const; // // Mandates: Count <= Extent is true. #include #include void f() { int array[] = {1, 2, 3, 4}; std::span sp(array); // Count too large [[maybe_unused]] auto s1 = sp.first<5>(); // expected-error@span:* {{span::first(): Count out of range}} // Count numeric_limits [[maybe_unused]] auto s2 = sp.first(); // expected-error@span:* {{span::first(): Count out of range}} }