Skip to content

Extremely Slow Compilation and Timeout with std::ranges::copy and std::views::iota #139051

@mariete1223

Description

@mariete1223

Compiling a C++ program using std::ranges::copy in combination with std::views::iota causes extremely long compilation times (several minutes), sometimes resulting in a forced termination due to exceeded time limits (SIGKILL).

In local it do not end compiling, without giving any feedback.

Output

Killed - processing time exceeded
Program terminated with signal: SIGKILL
Compiler returned: 143

Program

#include <algorithm>
#include <iterator>
#include <iostream>
#include <numeric>
int main (int argc, char* argv[])
{
   std::copy (std::make_integer_iterator (1), std::make_integer_iterator (100), std::ostream_iterator<int> (std::cout));
   std::ranges::copy (std::views::iota (1, 100), std::ostream_iterator<int> (std::cout));
   return 0;
}

To quickly reproduce

https://gcc.godbolt.org/z/4q81GE1Pn

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions