1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // class nested_exception;
14 // nested_exception& operator=(const nested_exception&) throw() = default;
19 #include "test_macros.h"
25 explicit A(int data) : data_(data) {}
27 friend bool operator==(const A& x, const A& y) {return x.data_ == y.data_;}
33 std::nested_exception e0;
34 std::nested_exception e;
36 assert(e.nested_ptr() == nullptr);
38 #ifndef TEST_HAS_NO_EXCEPTIONS
47 std::nested_exception e0;
48 std::nested_exception e;
50 assert(e.nested_ptr() != nullptr);
53 rethrow_exception(e.nested_ptr());