exception.pass.cpp 751 B

12345678910111213141516171819202122232425262728
  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. // test exception
  9. #include <exception>
  10. #include <type_traits>
  11. #include <cassert>
  12. #include "test_macros.h"
  13. int main(int, char**)
  14. {
  15. static_assert(std::is_polymorphic<std::exception>::value,
  16. "std::is_polymorphic<std::exception>::value");
  17. std::exception b;
  18. std::exception b2 = b;
  19. b2 = b;
  20. const char* w = b2.what();
  21. assert(w);
  22. return 0;
  23. }