diff options
Diffstat (limited to 'libcxx/src/exception.cpp')
-rw-r--r-- | libcxx/src/exception.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp index e48e9c4901e..9bed6f49bf2 100644 --- a/libcxx/src/exception.cpp +++ b/libcxx/src/exception.cpp @@ -142,6 +142,23 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) #endif } +nested_exception::nested_exception() + : __ptr_(current_exception()) +{ +} + +nested_exception::~nested_exception() +{ +} + +void +nested_exception::rethrow_nested /*[[noreturn]]*/ () const +{ + if (__ptr_ == nullptr) + terminate(); + rethrow_exception(__ptr_); +} + } // std |