xref: /freebsd/contrib/llvm-project/libcxx/src/any.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
9*81ad6265SDimitry Andric #include <any>
100b57cec5SDimitry Andric 
110b57cec5SDimitry Andric namespace std {
12fe6060f1SDimitry Andric const char* bad_any_cast::what() const noexcept {
130b57cec5SDimitry Andric     return "bad any cast";
140b57cec5SDimitry Andric }
150b57cec5SDimitry Andric }
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric #include <experimental/__config>
190b57cec5SDimitry Andric 
200b57cec5SDimitry Andric //  Preserve std::experimental::any_bad_cast for ABI compatibility
210b57cec5SDimitry Andric //  Even though it no longer exists in a header file
220b57cec5SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_LFTS
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
250b57cec5SDimitry Andric {
260b57cec5SDimitry Andric public:
27fe6060f1SDimitry Andric     virtual const char* what() const noexcept;
280b57cec5SDimitry Andric };
290b57cec5SDimitry Andric 
30fe6060f1SDimitry Andric const char* bad_any_cast::what() const noexcept {
310b57cec5SDimitry Andric     return "bad any cast";
320b57cec5SDimitry Andric }
330b57cec5SDimitry Andric 
340b57cec5SDimitry Andric _LIBCPP_END_NAMESPACE_LFTS
35