Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed as http://reviews.llvm.org/D16262

llvm-svn: 258107
diff --git a/libcxx/include/regex b/libcxx/include/regex
index b9dac47..ca455f0 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -4265,6 +4265,9 @@
     if (__first != __last && *__first == '\\')
     {
         _ForwardIterator __t1 = _VSTD::next(__first);
+        if (__t1 == __last)
+            __throw_regex_error<regex_constants::error_escape>();
+
         _ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
         if (__t2 != __t1)
             __first = __t2;