xref: /netbsd-src/external/apache2/llvm/dist/libcxx/src/any.cpp (revision 4d6fc14bc9b0c5bf3e30be318c143ee82cadd108)
1*4d6fc14bSjoerg //===---------------------------- any.cpp ---------------------------------===//
2*4d6fc14bSjoerg //
3*4d6fc14bSjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*4d6fc14bSjoerg // See https://llvm.org/LICENSE.txt for license information.
5*4d6fc14bSjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*4d6fc14bSjoerg //
7*4d6fc14bSjoerg //===----------------------------------------------------------------------===//
8*4d6fc14bSjoerg 
9*4d6fc14bSjoerg #include "any"
10*4d6fc14bSjoerg 
11*4d6fc14bSjoerg namespace std {
what() const12*4d6fc14bSjoerg const char* bad_any_cast::what() const noexcept {
13*4d6fc14bSjoerg     return "bad any cast";
14*4d6fc14bSjoerg }
15*4d6fc14bSjoerg }
16*4d6fc14bSjoerg 
17*4d6fc14bSjoerg 
18*4d6fc14bSjoerg #include <experimental/__config>
19*4d6fc14bSjoerg 
20*4d6fc14bSjoerg //  Preserve std::experimental::any_bad_cast for ABI compatibility
21*4d6fc14bSjoerg //  Even though it no longer exists in a header file
22*4d6fc14bSjoerg _LIBCPP_BEGIN_NAMESPACE_LFTS
23*4d6fc14bSjoerg 
24*4d6fc14bSjoerg class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
25*4d6fc14bSjoerg {
26*4d6fc14bSjoerg public:
27*4d6fc14bSjoerg     virtual const char* what() const noexcept;
28*4d6fc14bSjoerg };
29*4d6fc14bSjoerg 
what() const30*4d6fc14bSjoerg const char* bad_any_cast::what() const noexcept {
31*4d6fc14bSjoerg     return "bad any cast";
32*4d6fc14bSjoerg }
33*4d6fc14bSjoerg 
34*4d6fc14bSjoerg _LIBCPP_END_NAMESPACE_LFTS
35