Disallow repeating a case-change group.

Turn assertion into an error.
Fixes: https://github.com/boostorg/regex/issues/151
This commit is contained in:
jzmaddock
2021-10-13 17:59:56 +01:00
parent 2be85f36ee
commit b10c089aba
2 changed files with 16 additions and 1 deletions

View File

@ -496,5 +496,13 @@ void test_pocessive_repeats()
TEST_INVALID_REGEX("(ab + + +)", perl | mod_x);
TEST_INVALID_REGEX("(ab + + ?)", perl | mod_x);
#ifndef BOOST_REGEX_CXX03
// Some bug cases from https://github.com/boostorg/regex/issues/151
TEST_INVALID_REGEX("a|?+", perl | mod_x);
TEST_INVALID_REGEX("(?xi)a|?+", perl | mod_x);
TEST_INVALID_REGEX("(?xi)a|#\r*", perl | mod_x);
TEST_INVALID_REGEX("(?xi)|#\r*", perl | mod_x);
TEST_INVALID_REGEX("(?xi)|?+#\r*", perl | mod_x);
#endif
}