1c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//===----------------------------------------------------------------------===//
2c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//
3c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//                     The LLVM Compiler Infrastructure
4c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//
5b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant// This file is dual licensed under the MIT and the University of Illinois Open
6b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant// Source Licenses. See LICENSE.TXT for details.
7c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//
8c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//===----------------------------------------------------------------------===//
9c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant
10c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant// <memory>
11c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant
12c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant// class bad_weak_ptr
13c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//     : public std::exception
14c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant// {
15c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant// public:
16c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant//     bad_weak_ptr();
17c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant// };
18c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant
19c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant#include <memory>
20c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant#include <type_traits>
21c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant#include <cassert>
22c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant#include <cstring>
23c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant
24c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnantint main()
25c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant{
26c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant    static_assert((std::is_base_of<std::exception, std::bad_weak_ptr>::value), "");
27c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant    std::bad_weak_ptr e;
28c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant    std::bad_weak_ptr e2 = e;
29c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant    e2 = e;
30c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant    assert(std::strcmp(e.what(), "bad_weak_ptr") == 0);
31c52f43e72dfcea03037729649da84c23b3beb04aHoward Hinnant}
32