summaryrefslogtreecommitdiffstats
path: root/test/PCH/type_pack_element.cpp
blob: c4ed6c81e2e9c75a925fb2d7e38605c35894678b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -std=c++14 -x c++-header %s -emit-pch -o %t.pch
// RUN: %clang_cc1 -std=c++14 -x c++ /dev/null -include-pch %t.pch

template <int i>
struct X { };

using SizeT = decltype(sizeof(int));

template <SizeT i, typename ...T>
using TypePackElement = __type_pack_element<i, T...>;

void fn1() {
  X<0> x0 = TypePackElement<0, X<0>, X<1>, X<2>>{};
  X<1> x1 = TypePackElement<1, X<0>, X<1>, X<2>>{};
  X<2> x2 = TypePackElement<2, X<0>, X<1>, X<2>>{};
}