Home | History | Annotate | Download | only in span.cons
      1 // -*- C++ -*-
      2 //===------------------------------ span ---------------------------------===//
      3 //
      4 //                     The LLVM Compiler Infrastructure
      5 //
      6 // This file is dual licensed under the MIT and the University of Illinois Open
      7 // Source Licenses. See LICENSE.TXT for details.
      8 //
      9 //===---------------------------------------------------------------------===//
     10 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
     11 
     12 // <span>
     13 
     14 // constexpr span() noexcept;
     15 //
     16 //  Remarks: This constructor shall not participate in overload resolution
     17 //          unless Extent <= 0 is true.
     18 
     19 
     20 #include <span>
     21 #include <cassert>
     22 #include <string>
     23 
     24 #include "test_macros.h"
     25 
     26 int main ()
     27 {
     28     std::span<int, 2> s; // expected-error-re@span:* {{static_assert failed{{( due to requirement '2[LL]{0,2} == 0')?}} "Can't default construct a statically sized span with size > 0"}}
     29 
     30 //  TODO: This is what I want:
     31 // eXpected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
     32 }
     33