1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
10 // XFAIL: availability-bad_variant_access-missing
16 class bad_variant_access : public exception {
18 bad_variant_access() noexcept;
19 virtual const char* what() const noexcept;
26 #include <type_traits>
29 #include "test_macros.h"
31 int main(int, char**) {
32 static_assert(std::is_base_of
<std::exception
, std::bad_variant_access
>::value
,
34 static_assert(noexcept(std::bad_variant_access
{}), "must be noexcept");
35 static_assert(noexcept(std::bad_variant_access
{}.what()), "must be noexcept");
36 std::bad_variant_access ex
;