Exceptions store the message as reference counted string for
compatibility to libstdc++. Move the implementation into a header for
easier sharing with libc++abi. Merge a number of improvements from that
version. Provide a POD definition for <stdexcept>'s public use to avoid
cast dances. Discussed with Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207695 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/stdexcept b/include/stdexcept
index ef5de59..5fc912a 100644
--- a/include/stdexcept
+++ b/include/stdexcept
@@ -50,6 +50,14 @@
#pragma GCC system_header
#endif
+#ifndef _LIBCPP___REFSTRING
+_LIBCPP_BEGIN_NAMESPACE_STD
+class _LIBCPP_HIDDEN __libcpp_refstring {
+ const char *__imp_;
+};
+_LIBCPP_END_NAMESPACE_STD
+#endif
+
namespace std // purposefully not using versioning namespace
{
@@ -57,7 +65,7 @@
: public exception
{
private:
- void* __imp_;
+ _VSTD::__libcpp_refstring __imp_;
public:
explicit logic_error(const string&);
explicit logic_error(const char*);
@@ -74,7 +82,7 @@
: public exception
{
private:
- void* __imp_;
+ _VSTD::__libcpp_refstring __imp_;
public:
explicit runtime_error(const string&);
explicit runtime_error(const char*);