Make regex and any assert when they should throw an exception _but_ the user has decreed 'no exceptions'. This matches the behavior of string and vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1efadf976d
commit
fc93ce7349
@ -82,6 +82,7 @@ inline namespace fundamentals_v1 {
|
|||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
@ -106,7 +107,7 @@ inline void __throw_bad_any_cast()
|
|||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_any_cast();
|
throw bad_any_cast();
|
||||||
#else
|
#else
|
||||||
_VSTD::abort();
|
assert(!"bad_any_cast");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,6 +762,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#include <__undef_min_max>
|
#include <__undef_min_max>
|
||||||
|
|
||||||
@ -960,7 +961,9 @@ _LIBCPP_ALWAYS_INLINE
|
|||||||
void __throw_regex_error()
|
void __throw_regex_error()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw regex_error(_Ev);
|
throw regex_error(_Ev);
|
||||||
|
#else
|
||||||
|
assert(!"regex_error");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user