Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / language.support / support.exception / bad.exception / bad_exception.pass.cpp
blobb6a8f9caa1f6c9c4510e189360fe0af0ef37c20b
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 //===----------------------------------------------------------------------===//
9 // test bad_exception
11 #include <exception>
12 #include <type_traits>
13 #include <cassert>
15 #include "test_macros.h"
17 int main(int, char**)
19 static_assert((std::is_base_of<std::exception, std::bad_exception>::value),
20 "std::is_base_of<std::exception, std::bad_exception>::value");
21 static_assert(std::is_polymorphic<std::bad_exception>::value,
22 "std::is_polymorphic<std::bad_exception>::value");
23 std::bad_exception b;
24 std::bad_exception b2 = b;
25 b2 = b;
26 const char* w = b2.what();
27 assert(w);
29 return 0;