any: Add availability for experimental::bad_any_cast
As a follow up to r302172, add missing availability for bad_any_cast. rdar://problem/32161524 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305647 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1154,6 +1154,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
|||||||
__attribute__((availability(watchos,strict,introduced=3.0)))
|
__attribute__((availability(watchos,strict,introduced=3.0)))
|
||||||
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
|
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
|
||||||
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
|
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
|
||||||
|
#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable))
|
||||||
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
|
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
|
||||||
__attribute__((availability(macosx,strict,introduced=10.12))) \
|
__attribute__((availability(macosx,strict,introduced=10.12))) \
|
||||||
__attribute__((availability(ios,strict,introduced=10.0))) \
|
__attribute__((availability(ios,strict,introduced=10.0))) \
|
||||||
@@ -1179,6 +1180,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
|||||||
#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
|
#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
|
||||||
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
|
||||||
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
|
#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
|
||||||
|
#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
|
||||||
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
|
#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
|
||||||
#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
|
#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
|
||||||
#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
|
#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
|
||||||
@@ -1191,9 +1193,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
|||||||
#ifdef _LIBCPP_NO_EXCEPTIONS
|
#ifdef _LIBCPP_NO_EXCEPTIONS
|
||||||
#define _LIBCPP_AVAILABILITY_DYNARRAY
|
#define _LIBCPP_AVAILABILITY_DYNARRAY
|
||||||
#define _LIBCPP_AVAILABILITY_FUTURE
|
#define _LIBCPP_AVAILABILITY_FUTURE
|
||||||
|
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
#else
|
#else
|
||||||
#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
|
#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
|
||||||
#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
|
#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
|
||||||
|
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \
|
||||||
|
_LIBCPP_AVAILABILITY_BAD_ANY_CAST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Availability of stream API in the dylib got dropped and re-added. The
|
// Availability of stream API in the dylib got dropped and re-added. The
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ inline namespace fundamentals_v1 {
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_LFTS
|
_LIBCPP_BEGIN_NAMESPACE_LFTS
|
||||||
|
|
||||||
class _LIBCPP_EXCEPTION_ABI bad_any_cast : public bad_cast
|
class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual const char* what() const _NOEXCEPT;
|
virtual const char* what() const _NOEXCEPT;
|
||||||
@@ -98,6 +98,7 @@ public:
|
|||||||
#if _LIBCPP_STD_VER > 11 // C++ > 11
|
#if _LIBCPP_STD_VER > 11 // C++ > 11
|
||||||
|
|
||||||
_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
|
_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
|
||||||
|
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
void __throw_bad_any_cast()
|
void __throw_bad_any_cast()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
@@ -506,7 +507,7 @@ void swap(any & __lhs, any & __rhs) _NOEXCEPT
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _ValueType>
|
template <class _ValueType>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
_ValueType any_cast(any const & __v)
|
_ValueType any_cast(any const & __v)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(
|
||||||
@@ -522,7 +523,7 @@ _ValueType any_cast(any const & __v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _ValueType>
|
template <class _ValueType>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
_ValueType any_cast(any & __v)
|
_ValueType any_cast(any & __v)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(
|
||||||
@@ -537,7 +538,7 @@ _ValueType any_cast(any & __v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _ValueType>
|
template <class _ValueType>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
_ValueType any_cast(any && __v)
|
_ValueType any_cast(any && __v)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
// UNSUPPORTED: c++98, c++03, c++11
|
// UNSUPPORTED: c++98, c++03, c++11
|
||||||
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.12
|
// XFAIL: availability=macosx
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.11
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.10
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.9
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.7
|
|
||||||
// XFAIL: with_system_cxx_lib=macosx10.8
|
|
||||||
|
|
||||||
// <experimental/any>
|
// <experimental/any>
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ void assertEmpty(std::experimental::any const& a) {
|
|||||||
|
|
||||||
// Assert that an 'any' object stores the specified 'Type' and 'value'.
|
// Assert that an 'any' object stores the specified 'Type' and 'value'.
|
||||||
template <class Type>
|
template <class Type>
|
||||||
|
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
void assertContains(std::experimental::any const& a, int value = 1) {
|
void assertContains(std::experimental::any const& a, int value = 1) {
|
||||||
assert(!a.empty());
|
assert(!a.empty());
|
||||||
RTTI_ASSERT(a.type() == typeid(Type));
|
RTTI_ASSERT(a.type() == typeid(Type));
|
||||||
@@ -64,6 +65,7 @@ void assertContains(std::experimental::any const& a, int value = 1) {
|
|||||||
// Modify the value of a "test type" stored within an any to the specified
|
// Modify the value of a "test type" stored within an any to the specified
|
||||||
// 'value'.
|
// 'value'.
|
||||||
template <class Type>
|
template <class Type>
|
||||||
|
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||||
void modifyValue(std::experimental::any& a, int value) {
|
void modifyValue(std::experimental::any& a, int value) {
|
||||||
assert(!a.empty());
|
assert(!a.empty());
|
||||||
RTTI_ASSERT(a.type() == typeid(Type));
|
RTTI_ASSERT(a.type() == typeid(Type));
|
||||||
|
|||||||
Reference in New Issue
Block a user