summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/typeinfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcxx/src/typeinfo.cpp b/libcxx/src/typeinfo.cpp
index 931855b3665..17f725c684e 100644
--- a/libcxx/src/typeinfo.cpp
+++ b/libcxx/src/typeinfo.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include <stdlib.h>
+#include <cxxabi.h>
#include "typeinfo"
@@ -37,3 +38,11 @@ std::bad_typeid::what() const throw()
{
return "std::bad_typeid";
}
+
+#if __APPLE__
+ // On Darwin, the cxa_bad_* functions cannot be in the lower level library
+ // because bad_cast and bad_typeid are defined in his higher level library
+ void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); }
+ void __cxxabiv1::__cxa_bad_cast() { throw std::bad_cast(); }
+#endif
+
OpenPOWER on IntegriCloud