1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // class nested_exception;
13 // nested_exception& operator=(const nested_exception&) throw() = default;
18 #include "test_macros.h"
24 explicit A(int data
) : data_(data
) {}
26 friend bool operator==(const A
& x
, const A
& y
) {return x
.data_
== y
.data_
;}
32 std::nested_exception e0
;
33 std::nested_exception e
;
35 assert(e
.nested_ptr() == nullptr);
37 #ifndef TEST_HAS_NO_EXCEPTIONS
46 std::nested_exception e0
;
47 std::nested_exception e
;
49 assert(e
.nested_ptr() != nullptr);
52 std::rethrow_exception(e
.nested_ptr());