https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99833

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced:

namespace std {
template <int __v> struct integral_constant {
  static constexpr int value = __v;
};
template <typename> struct tuple_size;
template <unsigned long, typename> struct tuple_element;
template <long __i, typename _Tp>
using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
template <typename...> class tuple;
template <typename... _UTypes> tuple(_UTypes...) -> tuple<_UTypes...>;
template <typename _T1, typename _T2> class tuple<_T1, _T2> {
public:
  template <typename _U1, typename _U2> tuple(_U1, _U2);
};
template <typename... _Elements>
struct tuple_size<tuple<_Elements...>>
    : integral_constant<sizeof...(_Elements)> {};
template <unsigned long __i, typename _Head, typename... _Tail>
struct tuple_element<__i, tuple<_Head, _Tail...>>
    : tuple_element<__i - 1, tuple<_Tail...>> {};
template <typename _Head, typename... _Tail>
struct tuple_element<0, tuple<_Head, _Tail...>> {
  typedef _Head type;
};
template <long __i, typename... _Elements>
__tuple_element_t<__i, tuple<_Elements...>> get(tuple<_Elements...>);
} // namespace std
void f(auto x) {
  [&](auto...) {
    auto y = std::tuple{"", x};
    if constexpr (auto [_, z] = y; requires { z; })
      ;
  }();
}
auto main() -> int { f(2); }

Reply via email to