[Bug libstdc++/103664] std::regex_replace bug if the string contains \0
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 12 12:26:24 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103664
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-12-12
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The problem is that the overload of regex_replace taking a basic_string is
implemented in terms of the one taking a null-terminated string:
regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
const basic_regex<_Ch_type, _Rx_traits>& __e,
const basic_string<_Ch_type, _St, _Sa>& __fmt,
regex_constants::match_flag_type __flags
= regex_constants::match_default)
{
return regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
}
More information about the Gcc-bugs
mailing list