[libcxx] r305647 - any: Add availability for experimental::bad_any_cast

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 18 07:52:26 PDT 2017


Author: dexonsmith
Date: Sun Jun 18 09:52:26 2017
New Revision: 305647

URL: http://llvm.org/viewvc/llvm-project?rev=305647&view=rev
Log:
any: Add availability for experimental::bad_any_cast

As a follow up to r302172, add missing availability for bad_any_cast.

rdar://problem/32161524

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/experimental/any
    libcxx/trunk/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.assign/move.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.assign/value.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.cons/move.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.cons/value.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
    libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
    libcxx/trunk/test/support/experimental_any_helpers.h

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Sun Jun 18 09:52:26 2017
@@ -1154,6 +1154,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
   __attribute__((availability(watchos,strict,introduced=3.0)))
 #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
 #define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable))
 #define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS                               \
   __attribute__((availability(macosx,strict,introduced=10.12)))                \
   __attribute__((availability(ios,strict,introduced=10.0)))                    \
@@ -1179,6 +1180,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 #define _LIBCPP_AVAILABILITY_SHARED_MUTEX
 #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
 #define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
 #define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
 #define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
 #define _LIBCPP_AVAILABILITY_FUTURE_ERROR
@@ -1191,9 +1193,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 #ifdef _LIBCPP_NO_EXCEPTIONS
 #define _LIBCPP_AVAILABILITY_DYNARRAY
 #define _LIBCPP_AVAILABILITY_FUTURE
+#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 #else
 #define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
 #define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST                                \
+  _LIBCPP_AVAILABILITY_BAD_ANY_CAST
 #endif
 
 // Availability of stream API in the dylib got dropped and re-added.  The

Modified: libcxx/trunk/include/experimental/any
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/any?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/any (original)
+++ libcxx/trunk/include/experimental/any Sun Jun 18 09:52:26 2017
@@ -89,7 +89,7 @@ inline namespace fundamentals_v1 {
 
 _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:
     virtual const char* what() const _NOEXCEPT;
@@ -98,6 +98,7 @@ public:
 #if _LIBCPP_STD_VER > 11                                            // C++ > 11
 
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 void __throw_bad_any_cast()
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -506,7 +507,7 @@ void swap(any & __lhs, any & __rhs) _NOE
 }
 
 template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any const & __v)
 {
     static_assert(
@@ -522,7 +523,7 @@ _ValueType any_cast(any const & __v)
 }
 
 template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any & __v)
 {
     static_assert(
@@ -537,7 +538,7 @@ _ValueType any_cast(any & __v)
 }
 
 template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any && __v)
 {
     static_assert(

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.assign/copy.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.assign/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.assign/copy.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.assign/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.assign/move.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.assign/move.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.assign/move.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.assign/value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.assign/value.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.assign/value.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.assign/value.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.cons/copy.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.cons/copy.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.cons/copy.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.cons/move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.cons/move.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.cons/move.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.cons/move.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.cons/value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.cons/value.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.cons/value.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.cons/value.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp Sun Jun 18 09:52:26 2017
@@ -9,12 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// 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
+// XFAIL: availability=macosx
 
 // <experimental/any>
 

Modified: libcxx/trunk/test/support/experimental_any_helpers.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/experimental_any_helpers.h?rev=305647&r1=305646&r2=305647&view=diff
==============================================================================
--- libcxx/trunk/test/support/experimental_any_helpers.h (original)
+++ libcxx/trunk/test/support/experimental_any_helpers.h Sun Jun 18 09:52:26 2017
@@ -55,6 +55,7 @@ void assertEmpty(std::experimental::any
 
 // Assert that an 'any' object stores the specified 'Type' and 'value'.
 template <class Type>
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 void assertContains(std::experimental::any const& a, int value = 1) {
     assert(!a.empty());
     RTTI_ASSERT(a.type() == typeid(Type));
@@ -64,6 +65,7 @@ void assertContains(std::experimental::a
 // Modify the value of a "test type" stored within an any to the specified
 // 'value'.
 template <class Type>
+_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
 void modifyValue(std::experimental::any& a, int value) {
     assert(!a.empty());
     RTTI_ASSERT(a.type() == typeid(Type));




More information about the cfe-commits mailing list