• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: with_system_cxx_lib=macosx10.12
13 // XFAIL: with_system_cxx_lib=macosx10.11
14 // XFAIL: with_system_cxx_lib=macosx10.10
15 // XFAIL: with_system_cxx_lib=macosx10.9
16 
17 // <optional>
18 
19 // class bad_optional_access : public exception
20 
21 #include <optional>
22 #include <type_traits>
23 
24 #include "test_macros.h"
25 
main(int,char **)26 int main(int, char**)
27 {
28     using std::bad_optional_access;
29 
30     static_assert(std::is_base_of<std::exception, bad_optional_access>::value, "");
31     static_assert(std::is_convertible<bad_optional_access*, std::exception*>::value, "");
32 
33   return 0;
34 }
35