blob: 3aaf5ea553ef03b36de6e5f4bd4f43fa40b2dcd2 [file] [log] [blame]
Howard Hinnante7d746d2013-09-02 20:30:37 +00001//===------------------------ optional.cpp --------------------------------===//
2//
Chandler Carruth57b08b02019-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 Hinnante7d746d2013-09-02 20:30:37 +00006//
7//===----------------------------------------------------------------------===//
8
Eric Fiseliera9e65962016-10-12 07:46:20 +00009#include "optional"
Howard Hinnante7d746d2013-09-02 20:30:37 +000010
Eric Fiseliera9e65962016-10-12 07:46:20 +000011namespace std
12{
Eric Fiselierfc647db2016-10-12 06:48:31 +000013
Marshall Clow6a1d0782017-02-05 20:52:32 +000014bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
Marshall Clowe29b1ed2017-02-05 20:06:38 +000015
16const char* bad_optional_access::what() const _NOEXCEPT {
17 return "bad_optional_access";
18 }
Howard Hinnante7d746d2013-09-02 20:30:37 +000019
Eric Fiseliera9e65962016-10-12 07:46:20 +000020} // std
21
Marshall Clowb87adec2018-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