// RUN: %clang_cc1 -std=c++17 %s -verify // expected-no-diagnostics // This test attempts to ensure that the below template parameter pack // splitting technique executes in linear time in the number of template // parameters. The size of the list below is selected so as to execute // relatively quickly on a "good" compiler and to time out otherwise. template struct TypeList; namespace detail { template using Unsigned = unsigned; template using ListOfNUnsignedsImpl = TypeList...>; template using ListOfNUnsigneds = __make_integer_seq; template struct TypeWrapper { template using AsTemplate = T; }; template struct Splitter { template class ...L, template class ...R> struct Split { using Left = TypeList...>; using Right = TypeList...>; }; }; } template> struct SplitAtIndex; template struct SplitAtIndex, N, TypeList> : detail::Splitter:: template Split::template AsTemplate...> {}; template struct Rep : Rep::type, 1> {}; template struct Rep, 1> { typedef TypeList type; }; using Ints = Rep, 14>::type; template extern int Size; template constexpr int Size> = sizeof...(T); using Left = SplitAtIndex / 2>::Left; using Right = SplitAtIndex / 2>::Right; static_assert(Size == 8192); static_assert(Size == 8192); template struct Concat; template struct Concat, TypeList> { using type = TypeList; }; using Ints = Concat::type;