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

            Bug ID: 115046
           Summary: meta-recursion when apply join_view with as_const_view
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

I seriously doubt this is a more practical example of LWG 3986 since join_view
has a std::optional member to store the iterator, but I'm not sure about
whether this is a language bug or a library bug since MSVC doesn't have the
issue:


#include <ranges>
#include <list>

int main() {
  std::list<std::string_view> l;
  auto r = l | std::views::chunk(3)
             | std::views::transform(std::views::as_const)
             | std::views::join;
  for (auto&& elem : r) {
    // infinite meta-recursion
  }
}

https://godbolt.org/z/Morx4voT8

Reduction is a nightmare, so I only do it when I have time.

Reply via email to