summaryrefslogtreecommitdiffstats
path: root/libcxx/include/regex
diff options
context:
space:
mode:
authorMikhail Maltsev <mikhail.maltsev@arm.com>2018-01-24 12:45:18 +0000
committerMikhail Maltsev <mikhail.maltsev@arm.com>2018-01-24 12:45:18 +0000
commit48c63d879b4a3a84f4dd21256b4a3d29037055c8 (patch)
treed3925b971f0c083c6abac4a4cd2fcf8a678a62b9 /libcxx/include/regex
parente4453233d78788989c4bf2ff927a9e67433fb63d (diff)
downloadbcm5719-llvm-48c63d879b4a3a84f4dd21256b4a3d29037055c8.tar.gz
bcm5719-llvm-48c63d879b4a3a84f4dd21256b4a3d29037055c8.zip
[libcxx] Correctly handle invalid regex character class names
Summary: Currently when a regular expression contains an invalid character class name std::regex constructors throw an std::regex_error with std::regex_constants::error_brack code. This patch changes the code to std::regex_constants::error_ctype and adds a test. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42291 llvm-svn: 323322
Diffstat (limited to 'libcxx/include/regex')
-rw-r--r--libcxx/include/regex2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex
index ff84b2738b7..ed0781c91f3 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -4013,7 +4013,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
char_class_type __class_type =
__traits_.lookup_classname(__first, __temp, __flags_ & icase);
if (__class_type == 0)
- __throw_regex_error<regex_constants::error_brack>();
+ __throw_regex_error<regex_constants::error_ctype>();
__ml->__add_class(__class_type);
__first = _VSTD::next(__temp, 2);
return __first;
OpenPOWER on IntegriCloud