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(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
25 std::bad_cast::bad_cast() _NOEXCEPT
29 std::bad_typeid::bad_typeid() _NOEXCEPT
35 std::bad_cast::~bad_cast() _NOEXCEPT
40 std::bad_cast::what() const _NOEXCEPT
42 return "std::bad_cast";
45 std::bad_typeid::~bad_typeid() _NOEXCEPT
50 std::bad_typeid::what() const _NOEXCEPT
52 return "std::bad_typeid";
56 // On Darwin, the cxa_bad_* functions cannot be in the lower level library
57 // because bad_cast and bad_typeid are defined in his higher level library
58 void __cxxabiv1::__cxa_bad_typeid()
60 #ifndef _LIBCPP_NO_EXCEPTIONS
61 throw std::bad_typeid();
64 void __cxxabiv1::__cxa_bad_cast()
66 #ifndef _LIBCPP_NO_EXCEPTIONS
67 throw std::bad_cast();
72 #endif // !__GLIBCXX__
73 #endif // !LIBCXXRT && !_LIBCPPABI_VERSION