[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / pack_indexing.cpp
blob1c4dac0fd9a30a877637afa7ed89d7360481e266
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
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
7 template <int I, typename... U>
8 using Type = U...[I];
10 template <int I, auto...V>
11 constexpr auto Var = V...[I];
13 template <int I, auto...V>
14 decltype(V...[I]) foo() { return V...[I]; }
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>();