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(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
= e0
;
34 assert(e
.nested_ptr() == nullptr);
36 #ifndef TEST_HAS_NO_EXCEPTIONS
45 std::nested_exception e0
;
46 std::nested_exception e
= e0
;
47 assert(e
.nested_ptr() != nullptr);
50 std::rethrow_exception(e
.nested_ptr());