Fix debug mode build w/o exceptions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290652 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__debug b/include/__debug
index e3a5ec9..e0cef09 100644
--- a/include/__debug
+++ b/include/__debug
@@ -82,6 +82,9 @@
 
 // Setup the throwing debug handler during dynamic initialization.
 #if _LIBCPP_DEBUG_LEVEL >= 1 && defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
+# if defined(_LIBCPP_NO_EXCEPTIONS)
+#   error _LIBCPP_DEBUG_USE_EXCEPTIONS cannot be used when exceptions are disabled.
+# endif
 static bool __init_dummy = __libcpp_set_debug_function(__libcpp_throw_debug_function);
 #endif
 
diff --git a/lib/abi/CHANGELOG.TXT b/lib/abi/CHANGELOG.TXT
index bccca2e..15703fe 100644
--- a/lib/abi/CHANGELOG.TXT
+++ b/lib/abi/CHANGELOG.TXT
@@ -16,7 +16,7 @@
 Version 4.0
 -----------
 
-* rTBD - Add _LIBCPP_ASSERT debug handling functions
+* r290651 - Add _LIBCPP_ASSERT debug handling functions
 
   All Platforms
   -------------
diff --git a/src/debug.cpp b/src/debug.cpp
index fe27dc8..f2fc1ce 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -41,7 +41,11 @@
 }
 
 _LIBCPP_NORETURN void __libcpp_throw_debug_function(__libcpp_debug_info const& info) {
+#ifndef _LIBCPP_NO_EXCEPTIONS
   throw __libcpp_debug_exception(info);
+#else
+  __libcpp_abort_debug_function(info);
+#endif
 }
 
 struct __libcpp_debug_exception::__libcpp_debug_exception_imp {