https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102447
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- The std::regex{"[\\w-a]"} case will throw a std::regex_error exception now. I'd like to backport this, but I'm going to wait a while. I am not entirely confident that my changes won't cause regressions elsewhere in the bracket handling.