Louis Dionne | 9bd9388 | 2021-11-17 16:25:01 -0500 | [diff] [blame^] | 1 | //===----------------------------------------------------------------------===// |
Eric Fiselier | 78653ab | 2015-07-31 02:24:58 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 3 | // 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 Fiselier | 78653ab | 2015-07-31 02:24:58 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Eric Fiselier | f6b3bfe | 2016-08-11 03:13:11 +0000 | [diff] [blame] | 9 | #include "any" |
Eric Fiselier | 78653ab | 2015-07-31 02:24:58 +0000 | [diff] [blame] | 10 | |
Eric Fiselier | f6b3bfe | 2016-08-11 03:13:11 +0000 | [diff] [blame] | 11 | namespace std { |
Louis Dionne | 65358e1 | 2021-03-01 12:09:45 -0500 | [diff] [blame] | 12 | const char* bad_any_cast::what() const noexcept { |
Eric Fiselier | 78653ab | 2015-07-31 02:24:58 +0000 | [diff] [blame] | 13 | return "bad any cast"; |
| 14 | } |
Eric Fiselier | f6b3bfe | 2016-08-11 03:13:11 +0000 | [diff] [blame] | 15 | } |
Marshall Clow | 6c37449 | 2018-02-01 18:45:57 +0000 | [diff] [blame] | 16 | |
| 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 | |
| 24 | class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast |
| 25 | { |
| 26 | public: |
Louis Dionne | 65358e1 | 2021-03-01 12:09:45 -0500 | [diff] [blame] | 27 | virtual const char* what() const noexcept; |
Marshall Clow | 6c37449 | 2018-02-01 18:45:57 +0000 | [diff] [blame] | 28 | }; |
| 29 | |
Louis Dionne | 65358e1 | 2021-03-01 12:09:45 -0500 | [diff] [blame] | 30 | const char* bad_any_cast::what() const noexcept { |
Marshall Clow | 6c37449 | 2018-02-01 18:45:57 +0000 | [diff] [blame] | 31 | return "bad any cast"; |
| 32 | } |
| 33 | |
| 34 | _LIBCPP_END_NAMESPACE_LFTS |