blob: 415d23b0c942ba3c0930422484816881268d108d [file] [log] [blame]
Eric Fiselier78653ab2015-07-31 02:24:58 +00001//===---------------------------- any.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
Eric Fiselier78653ab2015-07-31 02:24:58 +00006//
7//===----------------------------------------------------------------------===//
8
Eric Fiselierf6b3bfe2016-08-11 03:13:11 +00009#include "any"
Eric Fiselier78653ab2015-07-31 02:24:58 +000010
Eric Fiselierf6b3bfe2016-08-11 03:13:11 +000011namespace std {
Louis Dionne65358e12021-03-01 12:09:45 -050012const char* bad_any_cast::what() const noexcept {
Eric Fiselier78653ab2015-07-31 02:24:58 +000013 return "bad any cast";
14}
Eric Fiselierf6b3bfe2016-08-11 03:13:11 +000015}
Marshall Clow6c374492018-02-01 18:45:57 +000016
17
18#include <experimental/__config>
19
20// Preserve std::experimental::any_bad_cast for ABI compatibility
21// Even though it no longer exists in a header file
22_LIBCPP_BEGIN_NAMESPACE_LFTS
23
24class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
25{
26public:
Louis Dionne65358e12021-03-01 12:09:45 -050027 virtual const char* what() const noexcept;
Marshall Clow6c374492018-02-01 18:45:57 +000028};
29
Louis Dionne65358e12021-03-01 12:09:45 -050030const char* bad_any_cast::what() const noexcept {
Marshall Clow6c374492018-02-01 18:45:57 +000031 return "bad any cast";
32}
33
34_LIBCPP_END_NAMESPACE_LFTS