| 1 |
// RUN: %clang_cc1 -std=c++14 -x c++-header %s -emit-pch -o %t.pch |
| 2 |
// RUN: %clang_cc1 -std=c++14 -x c++ /dev/null -include-pch %t.pch |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -std=c++14 -x c++-header %s -emit-pch -fpch-instantiate-templates -o %t.pch |
| 5 |
// RUN: %clang_cc1 -std=c++14 -x c++ /dev/null -include-pch %t.pch |
| 6 |
|
| 7 |
template <int i> |
| 8 |
struct X { }; |
| 9 |
|
| 10 |
using SizeT = decltype(sizeof(int)); |
| 11 |
|
| 12 |
template <SizeT i, typename ...T> |
| 13 |
using TypePackElement = __type_pack_element<i, T...>; |
| 14 |
|
| 15 |
void fn1() { |
| 16 |
X<0> x0 = TypePackElement<0, X<0>, X<1>, X<2>>{}; |
| 17 |
X<1> x1 = TypePackElement<1, X<0>, X<1>, X<2>>{}; |
| 18 |
X<2> x2 = TypePackElement<2, X<0>, X<1>, X<2>>{}; |
| 19 |
} |