xref: /llvm-project-15.0.7/libcxx/src/any.cpp (revision bbb0f2c7)
1eb8650a7SLouis Dionne //===----------------------------------------------------------------------===//
23461dbc0SEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63461dbc0SEric Fiselier //
73461dbc0SEric Fiselier //===----------------------------------------------------------------------===//
83461dbc0SEric Fiselier 
9*bbb0f2c7SArthur O'Dwyer #include <any>
103461dbc0SEric Fiselier 
11324506b9SEric Fiselier namespace std {
what() const125601305fSLouis Dionne const char* bad_any_cast::what() const noexcept {
133461dbc0SEric Fiselier     return "bad any cast";
143461dbc0SEric Fiselier }
15324506b9SEric Fiselier }
16b87adec4SMarshall Clow 
17b87adec4SMarshall Clow 
18b87adec4SMarshall Clow #include <experimental/__config>
19b87adec4SMarshall Clow 
20b87adec4SMarshall Clow //  Preserve std::experimental::any_bad_cast for ABI compatibility
21b87adec4SMarshall Clow //  Even though it no longer exists in a header file
22b87adec4SMarshall Clow _LIBCPP_BEGIN_NAMESPACE_LFTS
23b87adec4SMarshall Clow 
24b87adec4SMarshall Clow class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
25b87adec4SMarshall Clow {
26b87adec4SMarshall Clow public:
275601305fSLouis Dionne     virtual const char* what() const noexcept;
28b87adec4SMarshall Clow };
29b87adec4SMarshall Clow 
what() const305601305fSLouis Dionne const char* bad_any_cast::what() const noexcept {
31b87adec4SMarshall Clow     return "bad any cast";
32b87adec4SMarshall Clow }
33b87adec4SMarshall Clow 
34b87adec4SMarshall Clow _LIBCPP_END_NAMESPACE_LFTS
35