aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/stdexcept
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/stdexcept')
-rw-r--r--contrib/llvm-project/libcxx/include/stdexcept85
1 files changed, 41 insertions, 44 deletions
diff --git a/contrib/llvm-project/libcxx/include/stdexcept b/contrib/llvm-project/libcxx/include/stdexcept
index 68de6ced174a..5428535a1022 100644
--- a/contrib/llvm-project/libcxx/include/stdexcept
+++ b/contrib/llvm-project/libcxx/include/stdexcept
@@ -43,8 +43,8 @@ public:
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <cstdlib>
-#include <exception>
+#include <__exception/exception.h>
+#include <__verbose_abort>
#include <iosfwd> // for string forward decl
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -65,7 +65,7 @@ public:
__libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT;
~__libcpp_refstring();
- const char* c_str() const _NOEXCEPT {return __imp_;}
+ _LIBCPP_HIDE_FROM_ABI const char* c_str() const _NOEXCEPT {return __imp_;}
};
#endif // !_LIBCPP_ABI_VCRUNTIME
@@ -74,7 +74,7 @@ _LIBCPP_END_NAMESPACE_STD
namespace std // purposefully not using versioning namespace
{
-class _LIBCPP_EXCEPTION_ABI logic_error
+class _LIBCPP_EXPORTED_FROM_ABI logic_error
: public exception
{
#ifndef _LIBCPP_ABI_VCRUNTIME
@@ -97,7 +97,7 @@ public:
#endif
};
-class _LIBCPP_EXCEPTION_ABI runtime_error
+class _LIBCPP_EXPORTED_FROM_ABI runtime_error
: public exception
{
#ifndef _LIBCPP_ABI_VCRUNTIME
@@ -120,7 +120,7 @@ public:
#endif // _LIBCPP_ABI_VCRUNTIME
};
-class _LIBCPP_EXCEPTION_ABI domain_error
+class _LIBCPP_EXPORTED_FROM_ABI domain_error
: public logic_error
{
public:
@@ -128,12 +128,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- domain_error(const domain_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI domain_error(const domain_error&) _NOEXCEPT = default;
~domain_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI invalid_argument
+class _LIBCPP_EXPORTED_FROM_ABI invalid_argument
: public logic_error
{
public:
@@ -141,24 +141,24 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- invalid_argument(const invalid_argument&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI invalid_argument(const invalid_argument&) _NOEXCEPT = default;
~invalid_argument() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI length_error
+class _LIBCPP_EXPORTED_FROM_ABI length_error
: public logic_error
{
public:
_LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
_LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- length_error(const length_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI length_error(const length_error&) _NOEXCEPT = default;
~length_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI out_of_range
+class _LIBCPP_EXPORTED_FROM_ABI out_of_range
: public logic_error
{
public:
@@ -166,12 +166,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- out_of_range(const out_of_range&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI out_of_range(const out_of_range&) _NOEXCEPT = default;
~out_of_range() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI range_error
+class _LIBCPP_EXPORTED_FROM_ABI range_error
: public runtime_error
{
public:
@@ -179,12 +179,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- range_error(const range_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI range_error(const range_error&) _NOEXCEPT = default;
~range_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI overflow_error
+class _LIBCPP_EXPORTED_FROM_ABI overflow_error
: public runtime_error
{
public:
@@ -192,12 +192,12 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- overflow_error(const overflow_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI overflow_error(const overflow_error&) _NOEXCEPT = default;
~overflow_error() _NOEXCEPT override;
#endif
};
-class _LIBCPP_EXCEPTION_ABI underflow_error
+class _LIBCPP_EXPORTED_FROM_ABI underflow_error
: public runtime_error
{
public:
@@ -205,7 +205,7 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {}
#ifndef _LIBCPP_ABI_VCRUNTIME
- underflow_error(const underflow_error&) _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI underflow_error(const underflow_error&) _NOEXCEPT = default;
~underflow_error() _NOEXCEPT override;
#endif
};
@@ -215,96 +215,93 @@ public:
_LIBCPP_BEGIN_NAMESPACE_STD
// in the dylib
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_runtime_error(const char*);
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_logic_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw logic_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("logic_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_domain_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw domain_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("domain_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_invalid_argument(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw invalid_argument(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("invalid_argument was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_length_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw length_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("length_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_out_of_range(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw out_of_range(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("out_of_range was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_range_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw range_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("range_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_overflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw overflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("overflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_underflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw underflow_error(__msg);
#else
- ((void)__msg);
- _VSTD::abort();
+ _LIBCPP_VERBOSE_ABORT("underflow_error was thrown in -fno-exceptions mode with message \"%s\"", __msg);
#endif
}
_LIBCPP_END_NAMESPACE_STD
+#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cstdlib>
+# include <exception>
+#endif
+
#endif // _LIBCPP_STDEXCEPT