summaryrefslogtreecommitdiffstats
path: root/lib/libcxxabi/src/stdlib_exception.cpp
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2018-09-11 18:06:31 +0000
committerrobert <robert@openbsd.org>2018-09-11 18:06:31 +0000
commit8a05a458f6e66ba4e39e97f266f4fbfbbdf85f5b (patch)
treedaa979747ce9e345dc0680933d017c4bb0b5768c /lib/libcxxabi/src/stdlib_exception.cpp
parentmerge libunwind 6.0.0; ok patrick@, kettenis@ (diff)
downloadwireguard-openbsd-8a05a458f6e66ba4e39e97f266f4fbfbbdf85f5b.tar.xz
wireguard-openbsd-8a05a458f6e66ba4e39e97f266f4fbfbbdf85f5b.zip
import of libc++abi 6.0.0
Diffstat (limited to 'lib/libcxxabi/src/stdlib_exception.cpp')
-rw-r--r--lib/libcxxabi/src/stdlib_exception.cpp103
1 files changed, 103 insertions, 0 deletions
diff --git a/lib/libcxxabi/src/stdlib_exception.cpp b/lib/libcxxabi/src/stdlib_exception.cpp
new file mode 100644
index 00000000000..a8f71ab0ecc
--- /dev/null
+++ b/lib/libcxxabi/src/stdlib_exception.cpp
@@ -0,0 +1,103 @@
+//===---------------------------- exception.cpp ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#define _LIBCPP_BUILDING_LIBRARY
+#define _LIBCPP_BUILDING_NEW
+#include <new>
+#include <exception>
+
+namespace std
+{
+
+// exception
+
+exception::~exception() _NOEXCEPT
+{
+}
+
+const char* exception::what() const _NOEXCEPT
+{
+ return "std::exception";
+}
+
+// bad_exception
+
+bad_exception::~bad_exception() _NOEXCEPT
+{
+}
+
+const char* bad_exception::what() const _NOEXCEPT
+{
+ return "std::bad_exception";
+}
+
+
+// bad_alloc
+
+bad_alloc::bad_alloc() _NOEXCEPT
+{
+}
+
+bad_alloc::~bad_alloc() _NOEXCEPT
+{
+}
+
+const char*
+bad_alloc::what() const _NOEXCEPT
+{
+ return "std::bad_alloc";
+}
+
+// bad_array_new_length
+
+bad_array_new_length::bad_array_new_length() _NOEXCEPT
+{
+}
+
+bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_new_length::what() const _NOEXCEPT
+{
+ return "bad_array_new_length";
+}
+
+// bad_array_length
+
+#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
+
+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_BAD_ARRAY_LENGTH_DEFINED
+
+bad_array_length::bad_array_length() _NOEXCEPT
+{
+}
+
+bad_array_length::~bad_array_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_length::what() const _NOEXCEPT
+{
+ return "bad_array_length";
+}
+
+
+} // std