diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2016-08-25 15:09:01 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2016-08-25 15:09:01 +0000 |
| commit | d437fa5c8c1185af695b87cdd5ea83aa4a6e7382 (patch) | |
| tree | 2fc9b60f206ef14e242a52af06f8f95b95693962 /libcxx/include/typeinfo | |
| parent | b41b990e05797d1d69ea735bb168893974757422 (diff) | |
| download | bcm5719-llvm-d437fa5c8c1185af695b87cdd5ea83aa4a6e7382.tar.gz bcm5719-llvm-d437fa5c8c1185af695b87cdd5ea83aa4a6e7382.zip | |
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.
llvm-svn: 279744
Diffstat (limited to 'libcxx/include/typeinfo')
| -rw-r--r-- | libcxx/include/typeinfo | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo index 14ef77b31c3..fe9123e82e6 100644 --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -165,4 +165,16 @@ public: } // std +_LIBCPP_BEGIN_NAMESPACE_STD +_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +void __throw_bad_cast() +{ +#ifndef _LIBCPP_NO_EXCEPTIONS + throw bad_cast(); +#else + _VSTD::abort(); +#endif +} +_LIBCPP_END_NAMESPACE_STD + #endif // __LIBCPP_TYPEINFO |

