diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2016-08-25 17:47:09 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2016-08-25 17:47:09 +0000 |
| commit | 0fc8cec796387575c0c4a2635ba5579f60deeb75 (patch) | |
| tree | f63bdb0decdc8765207400d8af7d86f84fc09f48 /libcxx/include/any | |
| parent | 6c43b850b777eb60e8c2146d7a4e0303937078d9 (diff) | |
| download | bcm5719-llvm-0fc8cec796387575c0c4a2635ba5579f60deeb75.tar.gz bcm5719-llvm-0fc8cec796387575c0c4a2635ba5579f60deeb75.zip | |
Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore.
llvm-svn: 279763
Diffstat (limited to 'libcxx/include/any')
| -rw-r--r-- | libcxx/include/any | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libcxx/include/any b/libcxx/include/any index 03d694edf2c..6f742cbdf73 100644 --- a/libcxx/include/any +++ b/libcxx/include/any @@ -102,6 +102,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER > 14 +_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +void __throw_bad_any_cast() +{ +#ifndef _LIBCPP_NO_EXCEPTIONS + throw bad_any_cast(); +#else + _VSTD::abort(); +#endif +} + // Forward declarations class _LIBCPP_TYPE_VIS_ONLY any; @@ -579,7 +589,7 @@ _ValueType any_cast(any const & __v) using _Tp = add_const_t<remove_reference_t<_ValueType>>; _Tp * __tmp = _VSTD::any_cast<_Tp>(&__v); if (__tmp == nullptr) - __libcpp_throw(bad_any_cast()); + __throw_bad_any_cast(); return *__tmp; } @@ -594,7 +604,7 @@ _ValueType any_cast(any & __v) typedef typename remove_reference<_ValueType>::type _Tp; _Tp * __tmp = _VSTD::any_cast<_Tp>(&__v); if (__tmp == nullptr) - __libcpp_throw(bad_any_cast()); + __throw_bad_any_cast(); return *__tmp; } @@ -614,7 +624,7 @@ _ValueType any_cast(any && __v) >; _Tp * __tmp = _VSTD::any_cast<_Tp>(&__v); if (__tmp == nullptr) - __libcpp_throw(bad_any_cast()); + __throw_bad_any_cast(); return _VSTD::forward<_ForwardTp>(*__tmp); } |

