aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/pr99833.C
blob: 33230535e102a3a94683d2c464f940aa645d7edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/99833
// { dg-do compile { target c++20 } }

#include <tuple>

auto f(auto&& x)
{
  [&](auto...) {
    auto y = std::tuple{ "what's happening here?", x };
    if constexpr (auto [_, z] = y; requires { z; })
      return;
  }();
}

int main()
{
  f(42);
}