xref: /llvm-project/clang/test/PCH/pack_indexing.cpp (revision 8ce2045be0ce708af0bfce5dc14632fa15dc743a)
1 // RUN: %clang_cc1 -std=c++2c -x c++-header %s -emit-pch -o %t.pch
2 // RUN: %clang_cc1 -std=c++2c -x c++ /dev/null -include-pch %t.pch
3 
4 // RUN: %clang_cc1 -std=c++2c -x c++-header %s -emit-pch -fpch-instantiate-templates -o %t.pch
5 // RUN: %clang_cc1 -std=c++2c -x c++ /dev/null -include-pch %t.pch
6 
7 template <int I, typename... U>
8 using Type = U...[I];
9 
10 template <int I, auto...V>
11 constexpr auto Var = V...[I];
12 
13 template <int I, auto...V>
foo()14 decltype(V...[I]) foo() { return V...[I]; }
15 
fn1()16 void fn1() {
17   using A = Type<1, int, long, double>;
18   constexpr auto V = Var<2, 0, 1, 42>;
19   foo<2, 0, 1, 42>();
20 }
21