| //===----------------------------------------------------------------------===// |
| // The LLVM Compiler Infrastructure |
| // This file is dual licensed under the MIT and the University of Illinois Open |
| // Source Licenses. See LICENSE.TXT for details. |
| //===----------------------------------------------------------------------===// |
| // UNSUPPORTED: libcpp-no-exceptions |
| // class nested_exception; |
| // template <class E> void rethrow_if_nested(const E& e); |
| explicit A(int data) : data_(data) {} |
| virtual ~A() TEST_NOEXCEPT {} |
| friend bool operator==(const A& x, const A& y) {return x.data_ == y.data_;} |
| : public std::nested_exception, |
| explicit B(int data) : A(data) {} |
| C * operator&() const { assert(false); } // should not be called |
| std::rethrow_if_nested(a); |
| std::rethrow_if_nested(a); |
| std::rethrow_if_nested(C()); |