gcc/testsuite/g++.dg/cpp26/pack-indexing13.C
raw| 1 | // PR c++/117937 |
| 2 | // { dg-do compile { target c++26 } } |
| 3 | |
| 4 | using size_t = decltype(sizeof(0)); |
| 5 | |
| 6 | template<size_t...> |
| 7 | struct seq {}; |
| 8 | |
| 9 | void g(auto...) {} |
| 10 | |
| 11 | void |
| 12 | f (auto... args) |
| 13 | { |
| 14 | [&]<size_t... i>(seq<i...>) { |
| 15 | g(args...[i]...); |
| 16 | }(seq<0>()); |
| 17 | } |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | f(0); |
| 23 | } |