• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // This test hangs during recursive template instantiation with libstdc++
18 // UNSUPPORTED: libstdc++
19 
20 #include <utility>
21 #include <type_traits>
22 #include <cassert>
23 
24 #include "test_macros.h"
25 
main()26 int main()
27 {
28   typedef std::make_integer_sequence<int, -3> MakeSeqT;
29 
30   // std::make_integer_sequence is implemented using a compiler builtin if available.
31   // this builtin has different diagnostic messages than the fallback implementation.
32 #if TEST_HAS_BUILTIN(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
33     MakeSeqT i; // expected-error@utility:* {{integer sequences must have non-negative sequence length}}
34 #else
35     MakeSeqT i; // expected-error@utility:* {{static_assert failed "std::make_integer_sequence must have a non-negative sequence length"}}
36 #endif
37 }
38