https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111129
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |timshen at gcc dot gnu.org --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- This changed with r0-127716-g053eb1f31ede72 * include/bits/regex_compiler.h (_Comipler<>::_M_quantifier()): Fix parse error of multiple consecutive quantifiers like "a**". * include/bits/regex_compiler.tcc (_Comipler<>::_M_quantifier()): Likewise. * testsuite/28_regex/basic_regex/multiple_quantifiers.cc: New. That added the following tests: regex re1("a++"); regex re2("(a+)+"); The second one is fine, but the first is invalid. The "a**" case mentioned in the commit message is invalid too. I don't know why Tim wanted to accept the first one. ECMAscript and POSIX don't accept it. My GNU grep does, but I think that's just a bug in glibc's regcomp: https://sourceware.org/bugzilla/show_bug.cgi?id=20095