aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/lambda-generic12.C
blob: 219529c7c324e507b485e584f22cda314953aabc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR c++/115425
// { dg-do compile { target c++20 } }

using size_t = decltype(sizeof(0));

template <int... I>
struct X {};

template<int... Is>
void foo(X<Is...>);

template<auto>
struct S;

template<class T>
auto test() {
  constexpr static auto x = foo<X<__integer_pack (0)...>>(); // { dg-error "no matching function" }
  return []<size_t... Is>(X<Is...>) {
    (typename S<x[Is]>::type{}, ...);
  }(X<__integer_pack (0)...>{});
}

int main() {
  test<int>();
}