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 10 11 // Make sure that we don't blow up the template instantiation recursion depth 12 // for tuples of size <= 1024. 13 14 #include <tuple> 15 #include <cassert> 16 #include <utility> 17 18 template <std::size_t... I> 19 constexpr void CreateTuple(std::index_sequence<I...>) { 20 std::tuple<decltype(I)...> tuple(I...); 21 assert(std::get<0>(tuple) == 0); 22 assert(std::get<sizeof...(I)-1>(tuple) == sizeof...(I)-1); 23 } 24 25 constexpr bool test() { 26 CreateTuple(std::make_index_sequence<1024>{}); 27 return true; 28 } 29 30 int main(int, char**) { 31 test(); 32 static_assert(test(), ""); 33 return 0; 34 } 35