summaryrefslogtreecommitdiff
path: root/include/locale
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-08-25 15:09:01 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-08-25 15:09:01 +0000
commit14c09a2413ed5cc4914d1690f5dbfb9420a45b3c (patch)
tree8f7149218fefcbce3abf3ec60f3d31c126d9f63d /include/locale
parentfdb4f1713ece3c6f7fbf98f3ea3f8c19fa0c249e (diff)
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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/locale')
-rw-r--r--include/locale12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/locale b/include/locale
index 3d804e86f..339b52acd 100644
--- a/include/locale
+++ b/include/locale
@@ -3701,10 +3701,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
if (__r == codecvt_base::ok)
return __ws;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__wide_err_string_.empty())
- throw range_error("wstring_convert: from_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: from_bytes error");
+
return __wide_err_string_;
}
@@ -3790,10 +3790,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
return __bs;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__byte_err_string_.empty())
- throw range_error("wstring_convert: to_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: to_bytes error");
+
return __byte_err_string_;
}