14f7ab58eSDimitry Andric //===------------------------ optional.cpp --------------------------------===//
24f7ab58eSDimitry Andric //
34f7ab58eSDimitry Andric //                     The LLVM Compiler Infrastructure
44f7ab58eSDimitry Andric //
54f7ab58eSDimitry Andric // This file is dual licensed under the MIT and the University of Illinois Open
64f7ab58eSDimitry Andric // Source Licenses. See LICENSE.TXT for details.
74f7ab58eSDimitry Andric //
84f7ab58eSDimitry Andric //===----------------------------------------------------------------------===//
94f7ab58eSDimitry Andric 
10aed8d94eSDimitry Andric #include "optional"
114f7ab58eSDimitry Andric 
12aed8d94eSDimitry Andric namespace std
13aed8d94eSDimitry Andric {
144f7ab58eSDimitry Andric 
154f7ab58eSDimitry Andric bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
164f7ab58eSDimitry Andric 
what() const175ca5951eSDimitry Andric const char* bad_optional_access::what() const _NOEXCEPT {
185ca5951eSDimitry Andric   return "bad_optional_access";
195ca5951eSDimitry Andric   }
205ca5951eSDimitry Andric 
21aed8d94eSDimitry Andric } // std
22aed8d94eSDimitry Andric 
23*4ba319b5SDimitry Andric 
24*4ba319b5SDimitry Andric #include <experimental/__config>
25*4ba319b5SDimitry Andric 
26*4ba319b5SDimitry Andric //  Preserve std::experimental::bad_optional_access for ABI compatibility
27*4ba319b5SDimitry Andric //  Even though it no longer exists in a header file
28aed8d94eSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
29aed8d94eSDimitry Andric 
30*4ba319b5SDimitry Andric class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
31*4ba319b5SDimitry Andric     : public std::logic_error
32*4ba319b5SDimitry Andric {
33*4ba319b5SDimitry Andric public:
bad_optional_access()34*4ba319b5SDimitry Andric 	bad_optional_access() : std::logic_error("Bad optional Access") {}
35*4ba319b5SDimitry Andric 
36*4ba319b5SDimitry Andric //	Get the key function ~bad_optional_access() into the dylib
37*4ba319b5SDimitry Andric     virtual ~bad_optional_access() _NOEXCEPT;
38*4ba319b5SDimitry Andric };
39*4ba319b5SDimitry Andric 
40aed8d94eSDimitry Andric bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
414f7ab58eSDimitry Andric 
42d72607e9SDimitry Andric _LIBCPP_END_NAMESPACE_EXPERIMENTAL
43