[libc++] Validate the entire regex is consumed
This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.
Differential Revision: https://reviews.llvm.org/D62452
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 27c4eaac8c066eb1f7c5ad26c6fbc3e78eded778
diff --git a/src/regex.cpp b/src/regex.cpp
index a971f64..d31e494 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -53,6 +53,8 @@
return "An invalid regex grammar has been requested.";
case regex_constants::__re_err_empty:
return "An empty regex is not allowed in the POSIX grammar.";
+ case regex_constants::__re_err_parse:
+ return "The parser did not consume the entire regular expression.";
default:
break;
}