Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled.  Reviewed as: https://reviews.llvm.org/D23855.

llvm-svn: 279744
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: d437fa5c8c1185af695b87cdd5ea83aa4a6e7382
diff --git a/include/regex b/include/regex
index 42f3dbb..f8fb6af 100644
--- a/include/regex
+++ b/include/regex
@@ -764,7 +764,6 @@
 #include <memory>
 #include <vector>
 #include <deque>
-#include <cassert>
 
 #include <__undef_min_max>
 
@@ -959,13 +958,13 @@
 };
 
 template <regex_constants::error_type _Ev>
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
 void __throw_regex_error()
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
     throw regex_error(_Ev);
 #else
-    assert(!"regex_error");
+    _VSTD::abort();
 #endif
 }