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 //===----------------------------------------------------------------------===//
11 #if defined(__APPLE__) || defined(LIBCXXRT) || \
12 defined(LIBCXX_BUILDING_LIBCXXABI)
18 #if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
20 std::bad_cast::bad_cast() _NOEXCEPT
24 std::bad_typeid::bad_typeid() _NOEXCEPT
30 std::bad_cast::~bad_cast() _NOEXCEPT
35 std::bad_cast::what() const _NOEXCEPT
37 return "std::bad_cast";
40 std::bad_typeid::~bad_typeid() _NOEXCEPT
45 std::bad_typeid::what() const _NOEXCEPT
47 return "std::bad_typeid";
51 // On Darwin, the cxa_bad_* functions cannot be in the lower level library
52 // because bad_cast and bad_typeid are defined in his higher level library
53 void __cxxabiv1::__cxa_bad_typeid()
55 #ifndef _LIBCPP_NO_EXCEPTIONS
56 throw std::bad_typeid();
59 void __cxxabiv1::__cxa_bad_cast()
61 #ifndef _LIBCPP_NO_EXCEPTIONS
62 throw std::bad_cast();
67 #endif // !__GLIBCXX__
68 #endif // !LIBCXXRT && !_LIBCPPABI_VERSION