http://llvm.org/bugs/show_bug.cgi?id=10353
llvm-svn: 135125
diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp
index d629185..1e8ed88 100644
--- a/libcxx/src/new.cpp
+++ b/libcxx/src/new.cpp
@@ -28,6 +28,9 @@
__attribute__((__weak__, __visibility__("default")))
void *
operator new(std::size_t size)
+#if !__has_feature(cxx_noexcept)
+ throw(std::bad_alloc)
+#endif
{
if (size == 0)
size = 1;
@@ -71,6 +74,9 @@
__attribute__((__weak__, __visibility__("default")))
void*
operator new[](size_t size)
+#if !__has_feature(cxx_noexcept)
+ throw(std::bad_alloc)
+#endif
{
return ::operator new(size);
}