1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <exception>
11 
12 // typedef unspecified exception_ptr;
13 
14 // exception_ptr shall satisfy the requirements of NullablePointer.
15 
16 #include <exception>
17 #include <cassert>
18 
main()19 int main()
20 {
21     std::exception_ptr p;
22     assert(p == nullptr);
23     std::exception_ptr p2 = p;
24     assert(nullptr == p);
25     assert(!p);
26     assert(p2 == p);
27     p2 = p;
28     assert(p2 == p);
29     assert(p2 == nullptr);
30     std::exception_ptr p3 = nullptr;
31     assert(p3 == nullptr);
32     p3 = nullptr;
33     assert(p3 == nullptr);
34 }
35