blob: 3aaf5ea553ef03b36de6e5f4bd4f43fa40b2dcd2 [file] [log] [blame]
Howard Hinnant11424d32013-09-02 20:30:37 +00001//===------------------------ optional.cpp --------------------------------===//
2//
Chandler Carruthd2012102019-01-19 10:56:40 +00003// 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
Howard Hinnant11424d32013-09-02 20:30:37 +00006//
7//===----------------------------------------------------------------------===//
8
Eric Fiselierd4ec6352016-10-12 07:46:20 +00009#include "optional"
Howard Hinnant11424d32013-09-02 20:30:37 +000010
Eric Fiselierd4ec6352016-10-12 07:46:20 +000011namespace std
12{
Eric Fiselier60737dc2016-10-12 06:48:31 +000013
Marshall Clow53fc0372017-02-05 20:52:32 +000014bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
Marshall Clowa627d4a2017-02-05 20:06:38 +000015
16const char* bad_optional_access::what() const _NOEXCEPT {
17 return "bad_optional_access";
18 }
Howard Hinnant11424d32013-09-02 20:30:37 +000019
Eric Fiselierd4ec6352016-10-12 07:46:20 +000020} // std
21
Marshall Clow6c374492018-02-01 18:45:57 +000022
23#include <experimental/__config>
24
25// Preserve std::experimental::bad_optional_access for ABI compatibility
26// Even though it no longer exists in a header file
27_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
28
29class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
30 : public std::logic_error
31{
32public:
33 bad_optional_access() : std::logic_error("Bad optional Access") {}
34
35// Get the key function ~bad_optional_access() into the dylib
36 virtual ~bad_optional_access() _NOEXCEPT;
37};
38
39bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
40
41_LIBCPP_END_NAMESPACE_EXPERIMENTAL