Adding bad_array_length to libc++

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190478 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/new b/include/new
index 94a2849..b0c4792 100644
--- a/include/new
+++ b/include/new
@@ -27,6 +27,18 @@
     virtual const char* what() const noexcept;
 };
 
+class bad_array_length : public bad_alloc // C++14
+{
+public:
+    bad_array_length() noexcept;
+};
+
+class bad_array_new_length : public bad_alloc
+{
+public:
+    bad_array_new_length() noexcept;
+};
+
 struct nothrow_t {};
 extern const nothrow_t nothrow;
 typedef void (*new_handler)();
@@ -81,6 +93,17 @@
     virtual const char* what() const _NOEXCEPT;
 };
 
+#if defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
+class _LIBCPP_EXCEPTION_ABI bad_array_length
+    : public bad_alloc
+{
+public:
+    bad_array_length() _NOEXCEPT;
+    virtual ~bad_array_length() _NOEXCEPT;
+    virtual const char* what() const _NOEXCEPT;
+};
+#endif
+
 _LIBCPP_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec
 
 struct _LIBCPP_TYPE_VIS nothrow_t {};