[Bug libstdc++/77264] [7 Regression] std::string's replace gives wrong results with C++17, works with C++11

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 16 12:06:00 GMT 2016


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:

#include <string>

int main () {
  std::string str("xyz");
  char c = 'Y';
  str.replace(1, 1, &c, 1);
  if (str[1] != 'Y')
    __builtin_abort();
}


More information about the Gcc-bugs mailing list