| 1 |
// { dg-do compile { target c++26 } } |
| 2 |
|
| 3 |
int i; |
| 4 |
constexpr int idx() |
| 5 |
{ |
| 6 |
if consteval { return 0; } |
| 7 |
else { return i; } |
| 8 |
} |
| 9 |
|
| 10 |
template <int... Ns> |
| 11 |
int first () { return Ns...[idx()]; } |
| 12 |
|
| 13 |
int main() |
| 14 |
{ |
| 15 |
return first<0,1,2>(); |
| 16 |
} |