now works with -fno-exceptions and -fno-rtti

llvm-svn: 110828
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 54b409fdb9489b305bf95f4d4f52b49c7926c429
diff --git a/include/exception b/include/exception
index 51e8313..772ada4 100644
--- a/include/exception
+++ b/include/exception
@@ -141,6 +141,7 @@
 exception_ptr
 make_exception_ptr(_E __e)
 {
+#ifndef _LIBCPP_NO_EXCEPTIONS
     try
     {
         throw __e;
@@ -149,6 +150,7 @@
     {
         return current_exception();
     }
+#endif
 }
 
 // nested_exception
@@ -188,7 +190,9 @@
                                     >::type* = 0)
 #endif
 {
+#ifndef _LIBCPP_NO_EXCEPTIONS
     throw __nested<typename remove_reference<_Tp>::type>(_STD::forward<_Tp>(__t));
+#endif
 }
 
 template <class _Tp>
@@ -204,7 +208,9 @@
                                     >::type* = 0)
 #endif
 {
+#ifndef _LIBCPP_NO_EXCEPTIONS
     throw _STD::forward<_Tp>(__t);
+#endif
 }
 
 template <class _E>