Fix an incorrect 'Throws' in the regex code. Add a test for the new behavior. Reviewed as https://reviews.llvm.org/D61828. Thanks to Mark for the catch and the fix.
llvm-svn: 361887
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 1efbe67414fd66e74050fb02100f04265e0a51ae
diff --git a/include/regex b/include/regex
index 1f397cd..a0e3ba6 100644
--- a/include/regex
+++ b/include/regex
@@ -2306,7 +2306,7 @@
else
{
if (__b.size() != 1 || __e.size() != 1)
- __throw_regex_error<regex_constants::error_collate>();
+ __throw_regex_error<regex_constants::error_range>();
if (__icase_)
{
__b[0] = __traits_.translate_nocase(__b[0]);