xref: /llvm-project/libcxx/test/std/language.support/support.exception/exception/exception.pass.cpp (revision 5a83710e371fe68a06e6e3876c6a2c8b820a8976)
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 exception
11 
12 #include <exception>
13 #include <type_traits>
14 #include <cassert>
15 
16 int main()
17 {
18     static_assert(std::is_polymorphic<std::exception>::value,
19                  "std::is_polymorphic<std::exception>::value");
20     std::exception b;
21     std::exception b2 = b;
22     b2 = b;
23     const char* w = b2.what();
24     assert(w);
25 }
26