summaryrefslogtreecommitdiffstats
path: root/libcxx/src
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
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')
-rw-r--r--libcxx/src/hash.cpp4
-rw-r--r--libcxx/src/locale.cpp2
-rw-r--r--libcxx/src/system_error.cpp3
-rw-r--r--libcxx/src/thread.cpp2
-rw-r--r--libcxx/src/typeinfo.cpp14
5 files changed, 23 insertions, 2 deletions
diff --git a/libcxx/src/hash.cpp b/libcxx/src/hash.cpp
index a013500218e..75e773a3a64 100644
--- a/libcxx/src/hash.cpp
+++ b/libcxx/src/hash.cpp
@@ -155,6 +155,8 @@ __check_for_overflow(size_t N)
#ifndef _LIBCPP_NO_EXCEPTIONS
if (N > 0xFFFFFFFB)
throw overflow_error("__next_prime overflow");
+#else
+ (void)N;
#endif
}
@@ -166,6 +168,8 @@ __check_for_overflow(size_t N)
#ifndef _LIBCPP_NO_EXCEPTIONS
if (N > 0xFFFFFFFFFFFFFFC5ull)
throw overflow_error("__next_prime overflow");
+#else
+ (void)N;
#endif
}
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index b7a47843b3d..90bc77c92fe 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -6003,6 +6003,8 @@ void __throw_runtime_error(const char* msg)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw runtime_error(msg);
+#else
+ (void)msg;
#endif
}
diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp
index 763d62c2a0b..7376b770ecf 100644
--- a/libcxx/src/system_error.cpp
+++ b/libcxx/src/system_error.cpp
@@ -195,6 +195,9 @@ __throw_system_error(int ev, const char* what_arg)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw system_error(error_code(ev, system_category()), what_arg);
+#else
+ (void)ev;
+ (void)what_arg;
#endif
}
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 7a06b296d44..635500292bb 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -36,6 +36,8 @@ thread::join()
#ifndef _LIBCPP_NO_EXCEPTIONS
if (ec)
throw system_error(error_code(ec, system_category()), "thread::join failed");
+#else
+ (void)ec;
#endif // _LIBCPP_NO_EXCEPTIONS
__t_ = 0;
}
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