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 // test bad_exception
11 
12 #include <exception>
13 #include <type_traits>
14 #include <cassert>
15 
main()16 int main()
17 {
18     static_assert((std::is_base_of<std::exception, std::bad_exception>::value),
19                  "std::is_base_of<std::exception, std::bad_exception>::value");
20     static_assert(std::is_polymorphic<std::bad_exception>::value,
21                  "std::is_polymorphic<std::bad_exception>::value");
22     std::bad_exception b;
23     std::bad_exception b2 = b;
24     b2 = b;
25     const char* w = b2.what();
26     assert(w);
27 }
28