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 // UNSUPPORTED: c++03, c++11, c++14
10 
11 // Throwing bad_optional_access is supported starting in macosx10.13
12 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
13 
14 // <optional>
15 
16 // class bad_optional_access : public exception
17 
18 #include <optional>
19 #include <type_traits>
20 
21 #include "test_macros.h"
22 
main(int,char **)23 int main(int, char**)
24 {
25     using std::bad_optional_access;
26 
27     static_assert(std::is_base_of<std::exception, bad_optional_access>::value, "");
28     static_assert(std::is_convertible<bad_optional_access*, std::exception*>::value, "");
29 
30   return 0;
31 }
32