xref: /llvm-project/libcxx/test/std/language.support/support.exception/exception/exception.pass.cpp (revision 57b08b0944046a6a57ee9b7b479181f548a5b9b4)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // test exception
10 
11 #include <exception>
12 #include <type_traits>
13 #include <cassert>
14 
15 int main()
16 {
17     static_assert(std::is_polymorphic<std::exception>::value,
18                  "std::is_polymorphic<std::exception>::value");
19     std::exception b;
20     std::exception b2 = b;
21     b2 = b;
22     const char* w = b2.what();
23     assert(w);
24 }
25