1 //===------------------------- typeinfo.cpp -------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 #define __has_include(inc) 0
17 #elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
23 #if !(defined(_LIBCPPABI_VERSION) || defined(LIBCXXRT))
25 std::bad_cast::bad_cast() _NOEXCEPT
29 std::bad_cast::~bad_cast() _NOEXCEPT
34 std::bad_cast::what() const _NOEXCEPT
36 return "std::bad_cast";
39 std::bad_typeid::bad_typeid() _NOEXCEPT
43 std::bad_typeid::~bad_typeid() _NOEXCEPT
48 std::bad_typeid::what() const _NOEXCEPT
50 return "std::bad_typeid";
54 // On Darwin, the cxa_bad_* functions cannot be in the lower level library
55 // because bad_cast and bad_typeid are defined in his higher level library
56 void __cxxabiv1::__cxa_bad_typeid()
58 #ifndef _LIBCPP_NO_EXCEPTIONS
59 throw std::bad_typeid();
62 void __cxxabiv1::__cxa_bad_cast()
64 #ifndef _LIBCPP_NO_EXCEPTIONS
65 throw std::bad_cast();
70 #endif // _LIBCPPABI_VERSION