summaryrefslogtreecommitdiffstats
path: root/libcxx/src/typeinfo.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-03-28 18:56:26 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-03-28 18:56:26 +0000
commite00e6f23d36a802c7a81876891e4b470513d9cae (patch)
treeea10fa11758ca1cb9df4e66760c2b5559c58420f /libcxx/src/typeinfo.cpp
parenta6788325cf19ee25af3e84f89716e150115d361f (diff)
downloadbcm5719-llvm-e00e6f23d36a802c7a81876891e4b470513d9cae.tar.gz
bcm5719-llvm-e00e6f23d36a802c7a81876891e4b470513d9cae.zip
Fix a few warnings/errors for compiling with -fno-exceptions.
llvm-svn: 178267
Diffstat (limited to 'libcxx/src/typeinfo.cpp')
-rw-r--r--libcxx/src/typeinfo.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libcxx/src/typeinfo.cpp b/libcxx/src/typeinfo.cpp
index 7b47d74123d..60828944a1b 100644
--- a/libcxx/src/typeinfo.cpp
+++ b/libcxx/src/typeinfo.cpp
@@ -53,8 +53,18 @@ std::bad_typeid::what() const _NOEXCEPT
#ifdef __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(); }
+ void __cxxabiv1::__cxa_bad_typeid()
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_typeid();
+#endif
+ }
+ void __cxxabiv1::__cxa_bad_cast()
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_cast();
+#endif
+ }
#endif
#endif // _LIBCPPABI_VERSION
OpenPOWER on IntegriCloud