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
This commit is contained in:
@@ -50,6 +50,14 @@ public:
|
||||
#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 @@ class _LIBCPP_EXCEPTION_ABI logic_error
|
||||
: public exception
|
||||
{
|
||||
private:
|
||||
void* __imp_;
|
||||
_VSTD::__libcpp_refstring __imp_;
|
||||
public:
|
||||
explicit logic_error(const string&);
|
||||
explicit logic_error(const char*);
|
||||
@@ -74,7 +82,7 @@ class _LIBCPP_EXCEPTION_ABI runtime_error
|
||||
: public exception
|
||||
{
|
||||
private:
|
||||
void* __imp_;
|
||||
_VSTD::__libcpp_refstring __imp_;
|
||||
public:
|
||||
explicit runtime_error(const string&);
|
||||
explicit runtime_error(const char*);
|
||||
|
Reference in New Issue
Block a user