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

--- Comment #4 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
actually, it seems to be the comma, not the fold; the following also fails:

#include <array>
#include <generator>
#include <ranges>
#include <vector>

using namespace std;

template <ranges::input_range Range1, ranges::input_range Range2>
[[nodiscard]] auto
concat(Range1&& range1, Range2&& range2) -> generator<int, int>
{
  co_yield ranges::elements_of(range1), // <-
  co_yield ranges::elements_of(range2);
}

auto
main() -> int
{
  auto const numbers1 = array{0};
  auto const numbers2 = vector{0};
  for (auto const _: concat(numbers1, numbers2) ) {}
}

Reply via email to