Debian Codegraph @

gcc/testsuite/g++.dg/cpp26/pack-indexing10.C

raw
1 // P2662R3 - Pack Indexing
2 // PR c++/113798
3 // { dg-do compile { target c++26 } }
4
5 template<auto... Vs>
6 constexpr auto f() {
7 return []<int N>() { return Vs...[N]; }.template operator()<1>();
8 }
9 static_assert(f<1, 2, 3>() == 2);
10
11 template<int N>
12 constexpr auto g() {
13 return []<auto... Vs>() { return Vs...[N]; }.template operator()<1, 2, 3>();
14 }
15 static_assert(g<1>() == 2);