summaryrefslogtreecommitdiff
path: root/include/deque
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/deque
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/deque')
-rw-r--r--include/deque12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/deque b/include/deque
index 4c688132b..9c72d24c2 100644
--- a/include/deque
+++ b/include/deque
@@ -895,26 +895,22 @@ template <bool>
class __deque_base_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__deque_base_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("deque");
-#endif
+ _VSTD::__throw_length_error("deque");
}
template <bool __b>
void
__deque_base_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("deque");
-#endif
+ _VSTD::__throw_out_of_range("deque");
}
template <class _Tp, class _Allocator>