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

            Bug ID: 126764
           Summary: Substring, std permutations and stoi(), strange error
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jori.mantysalo at tuni dot fi
  Target Milestone: ---

In my computer this stucks on string 2147503689. Also tested on g++ version
14.3.0, same result.

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s = "1234567890";
    do {
      cout << s   << endl;
      stoi(s.substr(0, 10));
    }
    while (std::next_permutation(s.begin(), s.end()));
}
  • [Bug c++/126764] New: Substring... jori.mantysalo at tuni dot fi via Gcc-bugs

Reply via email to