| 1 |
// PR c++/115425 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
using size_t = decltype(sizeof(0)); |
| 5 |
|
| 6 |
template <int... I> |
| 7 |
struct X {}; |
| 8 |
|
| 9 |
template<int... Is> |
| 10 |
void foo(X<Is...>); |
| 11 |
|
| 12 |
template<auto> |
| 13 |
struct S; |
| 14 |
|
| 15 |
template<class T> |
| 16 |
auto test() { |
| 17 |
constexpr static auto x = foo<X<__integer_pack (0)...>>(); // { dg-error "no matching function" } |
| 18 |
return []<size_t... Is>(X<Is...>) { |
| 19 |
(typename S<x[Is]>::type{}, ...); |
| 20 |
}(X<__integer_pack (0)...>{}); |
| 21 |
} |
| 22 |
|
| 23 |
int main() { |
| 24 |
test<int>(); |
| 25 |
} |