gcc/testsuite/g++.dg/cpp26/pack-indexing20.C
raw| 1 | // PR c++/124198 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | // { dg-options "-Wunused-but-set-variable" } |
| 4 | |
| 5 | template <int ...N> |
| 6 | int |
| 7 | foo () |
| 8 | { |
| 9 | constexpr int a = 1; // { dg-bogus "variable 'a' set but not used" } |
| 10 | return N...[a]; // { dg-warning "pack indexing only available with" "" { target c++23_down } } |
| 11 | } |
| 12 | |
| 13 | int a = foo <1, 2, 3> (); |