From 019fe4b8fdbc5958746e0026fa14b43c2477a7a8 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 27 May 2010 17:06:52 +0000 Subject: [except.nested] llvm-svn: 104850 --- libcxx/src/exception.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libcxx/src/exception.cpp') 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 -- cgit v1.2.3