https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84110
--- Comment #1 from AbigailBuccaneer <abigail.buccaneer at gmail dot com> ---
From what I can tell, this isn't intentional behavior in libstdc++.
regex_scanner.h defines:
const char* _M_ecma_spec_char = "^$\\.*+?()[]{}|";
and regex_scanner.tcc tries to interpret any character not in this set of
special characters as an ordinary character token:
if (std::strchr(_M_spec_char, _M_ctype.narrow(__c, ' ')) == nullptr)
{
_M_token = _S_token_ord_char;
_M_value.assign(1, __c);
return;
}
However, the strchr specification says (emphasis mine):
Description: The strchr function locates the first occurrence of c (converted
to a char) in the string pointed to by s. ***The terminating null character is
considered to be part of the string***.