xref: /aosp_15_r20/external/libcxx/src/any.cpp (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker //===---------------------------- any.cpp ---------------------------------===//
2*58b9f456SAndroid Build Coastguard Worker //
3*58b9f456SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*58b9f456SAndroid Build Coastguard Worker //
5*58b9f456SAndroid Build Coastguard Worker // This file is dual licensed under the MIT and the University of Illinois Open
6*58b9f456SAndroid Build Coastguard Worker // Source Licenses. See LICENSE.TXT for details.
7*58b9f456SAndroid Build Coastguard Worker //
8*58b9f456SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*58b9f456SAndroid Build Coastguard Worker 
10*58b9f456SAndroid Build Coastguard Worker #include "any"
11*58b9f456SAndroid Build Coastguard Worker 
12*58b9f456SAndroid Build Coastguard Worker namespace std {
what() const13*58b9f456SAndroid Build Coastguard Worker const char* bad_any_cast::what() const _NOEXCEPT {
14*58b9f456SAndroid Build Coastguard Worker     return "bad any cast";
15*58b9f456SAndroid Build Coastguard Worker }
16*58b9f456SAndroid Build Coastguard Worker }
17*58b9f456SAndroid Build Coastguard Worker 
18*58b9f456SAndroid Build Coastguard Worker 
19*58b9f456SAndroid Build Coastguard Worker #include <experimental/__config>
20*58b9f456SAndroid Build Coastguard Worker 
21*58b9f456SAndroid Build Coastguard Worker //  Preserve std::experimental::any_bad_cast for ABI compatibility
22*58b9f456SAndroid Build Coastguard Worker //  Even though it no longer exists in a header file
23*58b9f456SAndroid Build Coastguard Worker _LIBCPP_BEGIN_NAMESPACE_LFTS
24*58b9f456SAndroid Build Coastguard Worker 
25*58b9f456SAndroid Build Coastguard Worker class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
26*58b9f456SAndroid Build Coastguard Worker {
27*58b9f456SAndroid Build Coastguard Worker public:
28*58b9f456SAndroid Build Coastguard Worker     virtual const char* what() const _NOEXCEPT;
29*58b9f456SAndroid Build Coastguard Worker };
30*58b9f456SAndroid Build Coastguard Worker 
what() const31*58b9f456SAndroid Build Coastguard Worker const char* bad_any_cast::what() const _NOEXCEPT {
32*58b9f456SAndroid Build Coastguard Worker     return "bad any cast";
33*58b9f456SAndroid Build Coastguard Worker }
34*58b9f456SAndroid Build Coastguard Worker 
35*58b9f456SAndroid Build Coastguard Worker _LIBCPP_END_NAMESPACE_LFTS
36