From 14c09a2413ed5cc4914d1690f5dbfb9420a45b3c Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 25 Aug 2016 15:09:01 +0000 Subject: 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 --- include/deque | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include/deque') diff --git a/include/deque b/include/deque index 4c688132b..9c72d24c2 100644 --- a/include/deque +++ b/include/deque @@ -895,26 +895,22 @@ template 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 void __deque_base_common<__b>::__throw_length_error() const { -#ifndef _LIBCPP_NO_EXCEPTIONS - throw length_error("deque"); -#endif + _VSTD::__throw_length_error("deque"); } template 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 -- cgit v1.2.3