https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89927
Tim Shen <timshen at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |timshen at gcc dot gnu.org --- Comment #1 from Tim Shen <timshen at gcc dot gnu.org> --- In the example, by std::regex(match_name_regex_string, "i"); did you mean std::regex_match( "i", std::regex(match_name_regex_string)); ? The former is UB because match_name_regex_string and "i" form an invalid range of two const char*.