1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <utility>
11 
12 // template<class T, T N>
13 //   using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>;
14 
15 // UNSUPPORTED: c++98, c++03, c++11
16 
17 #include <utility>
18 #include <type_traits>
19 #include <cassert>
20 
21 #include "test_macros.h"
22 
23 int main()
24 {
25   typedef std::make_integer_sequence<int, -3> MakeSeqT;
26 
27   // std::make_integer_sequence is implemented using a compiler builtin if available.
28   // this builtin has different diagnostic messages than the fallback implementation.
29 #if TEST_HAS_BUILTIN(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
30     MakeSeqT i; // expected-error@utility:* {{integer sequences must have non-negative sequence length}}
31 #else
32     MakeSeqT i; // expected-error@utility:* {{static_assert failed "std::make_integer_sequence must have a non-negative sequence length"}}
33 #endif
34 }
35