[lldb] Add SBThread.selected_frame property (#123981)
[llvm-project.git] / libcxx / test / std / utilities / variant / variant.bad_variant_access / bad_variant_access.pass.cpp
blob57c9d4bf1b0460a8ea2b27cb159f7dc005d1c76b
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 // UNSUPPORTED: c++03, c++11, c++14
11 // <variant>
15 class bad_variant_access : public exception {
16 public:
17 bad_variant_access() noexcept;
18 virtual const char* what() const noexcept;
23 #include <cassert>
24 #include <exception>
25 #include <type_traits>
26 #include <variant>
28 #include "test_macros.h"
30 int main(int, char**) {
31 static_assert(std::is_base_of<std::exception, std::bad_variant_access>::value,
32 "");
33 static_assert(noexcept(std::bad_variant_access{}), "must be noexcept");
34 static_assert(noexcept(std::bad_variant_access{}.what()), "must be noexcept");
35 std::bad_variant_access ex;
36 assert(ex.what());
38 return 0;