Browse Source

Add markup for libc++ dylib availability

Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.

See docs/DesignDocs/AvailabilityMarkup.rst for more information.

Differential Revision: https://reviews.llvm.org/D31739

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302172 91177308-0d34-0410-b5e6-96231b3b80d8
Mehdi Amini 8 years ago
parent
commit
907c1196a7
100 changed files with 610 additions and 67 deletions
  1. 114 0
      docs/DesignDocs/AvailabilityMarkup.rst
  2. 1 0
      docs/index.rst
  3. 73 0
      include/__config
  4. 1 0
      include/__locale
  5. 1 1
      include/exception
  6. 1 1
      include/experimental/dynarray
  7. 6 3
      include/experimental/optional
  8. 27 23
      include/future
  9. 2 0
      include/istream
  10. 12 1
      include/memory
  11. 9 7
      include/new
  12. 2 0
      include/ostream
  13. 3 3
      include/shared_mutex
  14. 2 0
      include/streambuf
  15. 1 0
      include/typeinfo
  16. 2 0
      test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
  17. 3 0
      test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
  18. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
  19. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
  20. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
  21. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
  22. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
  23. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
  24. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
  25. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
  26. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
  27. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
  28. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
  29. 3 0
      test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
  30. 3 0
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
  31. 3 0
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
  32. 3 0
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
  33. 3 0
      test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
  34. 3 0
      test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
  35. 3 0
      test/libcxx/debug/containers/db_string.pass.cpp
  36. 3 0
      test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
  37. 3 0
      test/libcxx/debug/debug_abort.pass.cpp
  38. 3 0
      test/libcxx/debug/debug_throw.pass.cpp
  39. 3 0
      test/libcxx/debug/debug_throw_register.pass.cpp
  40. 6 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
  41. 1 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
  42. 1 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
  43. 2 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
  44. 2 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
  45. 2 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
  46. 2 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
  47. 1 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
  48. 8 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
  49. 1 0
      test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
  50. 3 0
      test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg
  51. 9 0
      test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp
  52. 7 0
      test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
  53. 4 0
      test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp
  54. 7 0
      test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
  55. 7 0
      test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
  56. 7 0
      test/std/experimental/any/any.class/any.assign/copy.pass.cpp
  57. 7 0
      test/std/experimental/any/any.class/any.assign/move.pass.cpp
  58. 8 1
      test/std/experimental/any/any.class/any.assign/value.pass.cpp
  59. 7 0
      test/std/experimental/any/any.class/any.cons/copy.pass.cpp
  60. 7 0
      test/std/experimental/any/any.class/any.cons/move.pass.cpp
  61. 8 1
      test/std/experimental/any/any.class/any.cons/value.pass.cpp
  62. 7 0
      test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
  63. 7 0
      test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
  64. 2 0
      test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
  65. 1 1
      test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
  66. 3 2
      test/std/experimental/any/any.nonmembers/swap.pass.cpp
  67. 6 0
      test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
  68. 6 0
      test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
  69. 7 0
      test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
  70. 7 0
      test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
  71. 4 0
      test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
  72. 2 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
  73. 2 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
  74. 3 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
  75. 2 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
  76. 3 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
  77. 3 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
  78. 7 0
      test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
  79. 2 0
      test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
  80. 8 1
      test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
  81. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
  82. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
  83. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
  84. 6 0
      test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
  85. 7 2
      test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
  86. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
  87. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
  88. 7 0
      test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
  89. 5 0
      test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
  90. 8 0
      test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
  91. 2 2
      test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
  92. 0 3
      test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
  93. 0 3
      test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
  94. 0 3
      test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
  95. 0 3
      test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
  96. 2 1
      test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
  97. 2 1
      test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
  98. 2 2
      test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
  99. 4 2
      test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
  100. 15 0
      test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp

+ 114 - 0
docs/DesignDocs/AvailabilityMarkup.rst

@@ -0,0 +1,114 @@
+===================
+Availability Markup
+===================
+
+.. contents::
+   :local:
+
+Overview
+========
+
+Libc++ is used as a system library on macOS and iOS (amongst others). In order
+for users to be able to compile a binary that is intended to be deployed to an
+older version of the platform, clang provides the
+`availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>`_
+that can be placed on declarations to describe the lifecycle of a symbol in the
+library.
+
+Design
+======
+
+When a new feature is introduced that requires dylib support, a macro should be
+created in include/__config to mark this feature as unavailable for all the
+systems. For example::
+
+    // Define availability macros.
+    #if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+    #else  if defined(_LIBCPP_USE_AVAILABILITY_SOME_OTHER_VENDOR)
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+	#else
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+    #endif
+
+When the library is updated by the platform vendor, the markup can be updated.
+For example::
+
+    #define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                  \
+      __attribute__((availability(macosx,strict,introduced=10.12)))            \
+      __attribute__((availability(ios,strict,introduced=10.0)))                \
+      __attribute__((availability(tvos,strict,introduced=10.0)))               \
+      __attribute__((availability(watchos,strict,introduced=3.0)))
+
+In the source code, the macro can be added on a class if the full class requires
+type info from the library for example::
+
+	_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+	class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+	    : public std::logic_error {
+
+or on a particular symbol:
+
+    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+
+
+Testing
+=======
+
+Some parameters can be passed to lit to run the test-suite and exercising the
+availability.
+
+* The `platform` parameter controls the deployement target. For example lit can
+  be invoked with `--param=platform=macosx10.8`. Default is the current host.
+* The `use_system_cxx_lib` parameter indicates to use another library than the
+  just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
+  the test-suite against the host system library. Alternatively a path to the
+  directory containing a specific prebuilt libc++ can be used, for example:
+  `--param=use_system_cxx_lib=/path/to/macOS/10.8/`.
+* The `with_availability` boolean parameter enables the availability markup.
+
+Tests can be marked as XFAIL based on multiple features made available by lit:
+
+
+* if either `use_system_cxx_lib` or  `with_availability` is passed to lit,
+  assuming `--param=platform=macosx10.8` is passed as well the following
+  features will be available:
+
+  - availability
+  - availability=x86_64
+  - availability=macosx
+  - availability=x86_64-macosx
+  - availability=x86_64-apple-macosx10.8
+  - availability=macosx10.8
+
+  This feature is used to XFAIL a test that *is* using a class of a method marked
+  as unavailable *and* that is expected to *fail* if deployed on an older system.
+
+* if `use_system_cxx_lib` is passed to lit, the following features will also
+  be available:
+
+  - with_system_cxx_lib
+  - with_system_cxx_lib=x86_64
+  - with_system_cxx_lib=macosx
+  - with_system_cxx_lib=x86_64-macosx
+  - with_system_cxx_lib=x86_64-apple-macosx10.8
+  - with_system_cxx_lib=macosx10.8
+
+  This feature is used to XFAIL a test that is *not* using a class of a method
+  marked as unavailable *but* that is expected to fail if deployed on an older
+  system. For example if we know that it exhibits a but in the libc on a
+  particular system version.
+
+* if `with_availability` is passed to lit, the following features will also
+  be available:
+
+  - availability_markup
+  - availability_markup=x86_64
+  - availability_markup=macosx
+  - availability_markup=x86_64-macosx
+  - availability_markup=x86_64-apple-macosx10.8
+  - availability_markup=macosx10.8
+
+  This feature is used to XFAIL a test that *is* using a class of a method
+  marked as unavailable *but* that is expected to *pass* if deployed on an older
+  system. For example if it is using a symbol in a statically evaluated context.

+ 1 - 0
docs/index.rst

@@ -128,6 +128,7 @@ Design Documents
 .. toctree::
 .. toctree::
    :maxdepth: 1
    :maxdepth: 1
 
 
+   DesignDocs/AvailabilityMarkup
    DesignDocs/DebugMode
    DesignDocs/DebugMode
    DesignDocs/CapturingConfigInfo
    DesignDocs/CapturingConfigInfo
    DesignDocs/ABIVersioning
    DesignDocs/ABIVersioning

+ 73 - 0
include/__config

@@ -1113,4 +1113,77 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
 
 
 #endif // __cplusplus
 #endif // __cplusplus
 
 
+// Decide whether to use availability macros.
+#if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \
+    !defined(_LIBCPP_DISABLE_AVAILABILITY) &&                                  \
+    __has_feature(attribute_availability_with_strict) &&                       \
+    __has_feature(attribute_availability_in_templates)
+#ifdef __APPLE__
+#define _LIBCPP_USE_AVAILABILITY_APPLE
+#endif
+#endif
+
+// Define availability macros.
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                      \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __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_UNCAUGHT_EXCEPTIONS                               \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE                                  \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR                                      \
+  __attribute__((availability(ios,strict,introduced=6.0)))
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE                                   \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY                                   \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                                 \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#else
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
+#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#endif
+
+// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_DYNARRAY
+#define _LIBCPP_AVAILABILITY_FUTURE
+#else
+#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
+
+// Availability of stream API in the dylib got dropped and re-added.  The
+// extern template should effectively be available at:
+//    availability(macosx,introduced=10.9)
+//    availability(ios,introduced=7.0)
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) &&                                 \
+    ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&                \
+      __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1090) ||                \
+     (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&               \
+      __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000))
+#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#endif
+
 #endif // _LIBCPP_CONFIG
 #endif // _LIBCPP_CONFIG

+ 1 - 0
include/__locale

@@ -69,6 +69,7 @@ public:
     class _LIBCPP_TYPE_VIS id;
     class _LIBCPP_TYPE_VIS id;
 
 
     typedef int category;
     typedef int category;
+    _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
     static const category // values assigned here are for exposition only
     static const category // values assigned here are for exposition only
         none     = 0,
         none     = 0,
         collate  = LC_COLLATE_MASK,
         collate  = LC_COLLATE_MASK,

+ 1 - 1
include/exception

@@ -127,7 +127,7 @@ _LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
 
 
 _LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
 _LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS int uncaught_exceptions() _NOEXCEPT;
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
 
 
 class _LIBCPP_TYPE_VIS exception_ptr;
 class _LIBCPP_TYPE_VIS exception_ptr;
 
 

+ 1 - 1
include/experimental/dynarray

@@ -110,7 +110,7 @@ public:
 namespace std { namespace experimental { inline namespace __array_extensions_v1 {
 namespace std { namespace experimental { inline namespace __array_extensions_v1 {
 
 
 template <class _Tp>
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS dynarray
+struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_DYNARRAY dynarray
 {
 {
 public:
 public:
     // types:
     // types:

+ 6 - 3
include/experimental/optional

@@ -145,7 +145,7 @@ namespace std { namespace experimental { inline namespace fundamentals_v1 {
 #include <stdexcept>
 #include <stdexcept>
 
 
 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-class _LIBCPP_EXCEPTION_ABI bad_optional_access
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
     : public std::logic_error
     : public std::logic_error
 {
 {
 public:
 public:
@@ -523,6 +523,9 @@ public:
     constexpr explicit operator bool() const noexcept {return this->__engaged_;}
     constexpr explicit operator bool() const noexcept {return this->__engaged_;}
 
 
 	_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY 
 	_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY 
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#endif
 	constexpr void __throw_bad_optional_access() const
 	constexpr void __throw_bad_optional_access() const
 	{
 	{
 #ifndef _LIBCPP_NO_EXCEPTIONS
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -532,7 +535,7 @@ public:
 #endif
 #endif
 	}
 	}
 	
 	
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
     constexpr value_type const& value() const
     constexpr value_type const& value() const
     {
     {
         if (!this->__engaged_)
         if (!this->__engaged_)
@@ -540,7 +543,7 @@ public:
         return this->__val_;
         return this->__val_;
     }
     }
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
     value_type& value()
     value_type& value()
     {
     {
         if (!this->__engaged_)
         if (!this->__engaged_)

+ 27 - 23
include/future

@@ -499,7 +499,7 @@ make_error_condition(future_errc __e) _NOEXCEPT
     return error_condition(static_cast<int>(__e), future_category());
     return error_condition(static_cast<int>(__e), future_category());
 }
 }
 
 
-class _LIBCPP_EXCEPTION_ABI future_error
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
     : public logic_error
     : public logic_error
 {
 {
     error_code __ec_;
     error_code __ec_;
@@ -515,6 +515,9 @@ public:
 };
 };
 
 
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
 void __throw_future_error(future_errc _Ev)
 void __throw_future_error(future_errc _Ev)
 {
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -525,7 +528,7 @@ void __throw_future_error(future_errc _Ev)
 #endif
 #endif
 }
 }
 
 
-class _LIBCPP_TYPE_VIS __assoc_sub_state
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
     : public __shared_count
     : public __shared_count
 {
 {
 protected:
 protected:
@@ -612,7 +615,7 @@ __assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) c
 }
 }
 
 
 template <class _Rp>
 template <class _Rp>
-class __assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state
     : public __assoc_sub_state
     : public __assoc_sub_state
 {
 {
     typedef __assoc_sub_state base;
     typedef __assoc_sub_state base;
@@ -652,6 +655,7 @@ __assoc_state<_Rp>::__on_zero_shared() _NOEXCEPT
 
 
 template <class _Rp>
 template <class _Rp>
 template <class _Arg>
 template <class _Arg>
+_LIBCPP_AVAILABILITY_FUTURE
 void
 void
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __assoc_state<_Rp>::set_value(_Arg&& __arg)
 __assoc_state<_Rp>::set_value(_Arg&& __arg)
@@ -707,7 +711,7 @@ __assoc_state<_Rp>::copy()
 }
 }
 
 
 template <class _Rp>
 template <class _Rp>
-class __assoc_state<_Rp&>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
     : public __assoc_sub_state
     : public __assoc_sub_state
 {
 {
     typedef __assoc_sub_state base;
     typedef __assoc_sub_state base;
@@ -767,7 +771,7 @@ __assoc_state<_Rp&>::copy()
 }
 }
 
 
 template <class _Rp, class _Alloc>
 template <class _Rp, class _Alloc>
-class __assoc_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
     : public __assoc_state<_Rp>
     : public __assoc_state<_Rp>
 {
 {
     typedef __assoc_state<_Rp> base;
     typedef __assoc_state<_Rp> base;
@@ -795,7 +799,7 @@ __assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT
 }
 }
 
 
 template <class _Rp, class _Alloc>
 template <class _Rp, class _Alloc>
-class __assoc_state_alloc<_Rp&, _Alloc>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
     : public __assoc_state<_Rp&>
     : public __assoc_state<_Rp&>
 {
 {
     typedef __assoc_state<_Rp&> base;
     typedef __assoc_state<_Rp&> base;
@@ -821,7 +825,7 @@ __assoc_state_alloc<_Rp&, _Alloc>::__on_zero_shared() _NOEXCEPT
 }
 }
 
 
 template <class _Alloc>
 template <class _Alloc>
-class __assoc_sub_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
     : public __assoc_sub_state
     : public __assoc_sub_state
 {
 {
     typedef __assoc_sub_state base;
     typedef __assoc_sub_state base;
@@ -847,7 +851,7 @@ __assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
 }
 }
 
 
 template <class _Rp, class _Fp>
 template <class _Rp, class _Fp>
-class __deferred_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
     : public __assoc_state<_Rp>
     : public __assoc_state<_Rp>
 {
 {
     typedef __assoc_state<_Rp> base;
     typedef __assoc_state<_Rp> base;
@@ -894,7 +898,7 @@ __deferred_assoc_state<_Rp, _Fp>::__execute()
 }
 }
 
 
 template <class _Fp>
 template <class _Fp>
-class __deferred_assoc_state<void, _Fp>
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
     : public __assoc_sub_state
     : public __assoc_sub_state
 {
 {
     typedef __assoc_sub_state base;
     typedef __assoc_sub_state base;
@@ -942,7 +946,7 @@ __deferred_assoc_state<void, _Fp>::__execute()
 }
 }
 
 
 template <class _Rp, class _Fp>
 template <class _Rp, class _Fp>
-class __async_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
     : public __assoc_state<_Rp>
     : public __assoc_state<_Rp>
 {
 {
     typedef __assoc_state<_Rp> base;
     typedef __assoc_state<_Rp> base;
@@ -997,7 +1001,7 @@ __async_assoc_state<_Rp, _Fp>::__on_zero_shared() _NOEXCEPT
 }
 }
 
 
 template <class _Fp>
 template <class _Fp>
-class __async_assoc_state<void, _Fp>
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
     : public __assoc_sub_state
     : public __assoc_sub_state
 {
 {
     typedef __assoc_sub_state base;
     typedef __assoc_sub_state base;
@@ -1076,7 +1080,7 @@ __make_async_assoc_state(_Fp __f);
 #endif
 #endif
 
 
 template <class _Rp>
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS future
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
 {
 {
     __assoc_state<_Rp>* __state_;
     __assoc_state<_Rp>* __state_;
 
 
@@ -1179,7 +1183,7 @@ future<_Rp>::get()
 }
 }
 
 
 template <class _Rp>
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS future<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
 {
 {
     __assoc_state<_Rp&>* __state_;
     __assoc_state<_Rp&>* __state_;
 
 
@@ -1277,7 +1281,7 @@ future<_Rp&>::get()
 }
 }
 
 
 template <>
 template <>
-class _LIBCPP_TYPE_VIS future<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
 {
 {
     __assoc_sub_state* __state_;
     __assoc_sub_state* __state_;
 
 
@@ -1360,7 +1364,7 @@ swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
 template <class _Callable> class packaged_task;
 template <class _Callable> class packaged_task;
 
 
 template <class _Rp>
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS promise
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
 {
 {
     __assoc_state<_Rp>* __state_;
     __assoc_state<_Rp>* __state_;
 
 
@@ -1527,7 +1531,7 @@ promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
 // promise<R&>
 // promise<R&>
 
 
 template <class _Rp>
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS promise<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
 {
 {
     __assoc_state<_Rp&>* __state_;
     __assoc_state<_Rp&>* __state_;
 
 
@@ -1663,7 +1667,7 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
 // promise<void>
 // promise<void>
 
 
 template <>
 template <>
-class _LIBCPP_TYPE_VIS promise<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
 {
 {
     __assoc_sub_state* __state_;
     __assoc_sub_state* __state_;
 
 
@@ -1749,7 +1753,7 @@ template <class _Rp, class _Alloc>
 template<class _Fp> class __packaged_task_base;
 template<class _Fp> class __packaged_task_base;
 
 
 template<class _Rp, class ..._ArgTypes>
 template<class _Rp, class ..._ArgTypes>
-class __packaged_task_base<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
 {
 {
     __packaged_task_base(const __packaged_task_base&);
     __packaged_task_base(const __packaged_task_base&);
     __packaged_task_base& operator=(const __packaged_task_base&);
     __packaged_task_base& operator=(const __packaged_task_base&);
@@ -1767,7 +1771,7 @@ public:
 template<class _FD, class _Alloc, class _FB> class __packaged_task_func;
 template<class _FD, class _Alloc, class _FB> class __packaged_task_func;
 
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
     : public  __packaged_task_base<_Rp(_ArgTypes...)>
     : public  __packaged_task_base<_Rp(_ArgTypes...)>
 {
 {
     __compressed_pair<_Fp, _Alloc> __f_;
     __compressed_pair<_Fp, _Alloc> __f_;
@@ -1825,7 +1829,7 @@ __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ...
 template <class _Callable> class __packaged_task_function;
 template <class _Callable> class __packaged_task_function;
 
 
 template<class _Rp, class ..._ArgTypes>
 template<class _Rp, class ..._ArgTypes>
-class __packaged_task_function<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
 {
 {
     typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
     typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
     typename aligned_storage<3*sizeof(void*)>::type __buf_;
     typename aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -2000,7 +2004,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) cons
 }
 }
 
 
 template<class _Rp, class ..._ArgTypes>
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS packaged_task<_Rp(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
 {
 {
 public:
 public:
     typedef _Rp result_type; // extension
     typedef _Rp result_type; // extension
@@ -2129,7 +2133,7 @@ packaged_task<_Rp(_ArgTypes...)>::reset()
 }
 }
 
 
 template<class ..._ArgTypes>
 template<class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS packaged_task<void(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<void(_ArgTypes...)>
 {
 {
 public:
 public:
     typedef void result_type; // extension
     typedef void result_type; // extension
@@ -2517,7 +2521,7 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
 }
 }
 
 
 template <>
 template <>
-class _LIBCPP_TYPE_VIS shared_future<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
 {
 {
     __assoc_sub_state* __state_;
     __assoc_sub_state* __state_;
 
 

+ 2 - 0
include/istream

@@ -1675,9 +1675,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
     return __is;
     return __is;
 }
 }
 
 
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
+#endif
 
 
 _LIBCPP_END_NAMESPACE_STD
 _LIBCPP_END_NAMESPACE_STD
 
 

+ 12 - 1
include/memory

@@ -5293,7 +5293,8 @@ private:
     friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
     friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
 };
 };
 
 
-_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+__sp_mut& __get_sp_mut(const void*);
 
 
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
@@ -5304,6 +5305,7 @@ atomic_is_lock_free(const shared_ptr<_Tp>*)
 }
 }
 
 
 template <class _Tp>
 template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 shared_ptr<_Tp>
 atomic_load(const shared_ptr<_Tp>* __p)
 atomic_load(const shared_ptr<_Tp>* __p)
 {
 {
@@ -5316,6 +5318,7 @@ atomic_load(const shared_ptr<_Tp>* __p)
   
   
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 shared_ptr<_Tp>
 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 {
 {
@@ -5323,6 +5326,7 @@ atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 }
 }
 
 
 template <class _Tp>
 template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 void
 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
 {
@@ -5334,6 +5338,7 @@ atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 
 
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 void
 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
 {
@@ -5341,6 +5346,7 @@ atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 }
 }
 
 
 template <class _Tp>
 template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 shared_ptr<_Tp>
 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
 {
@@ -5353,6 +5359,7 @@ atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
   
   
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 shared_ptr<_Tp>
 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
 {
@@ -5360,6 +5367,7 @@ atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order
 }
 }
 
 
 template <class _Tp>
 template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 bool
 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
 {
@@ -5381,6 +5389,7 @@ atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, share
 
 
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 bool
 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
 {
@@ -5389,6 +5398,7 @@ atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_
 
 
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 bool
 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                         shared_ptr<_Tp> __w, memory_order, memory_order)
                                         shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5398,6 +5408,7 @@ atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* _
 
 
 template <class _Tp>
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 bool
 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                       shared_ptr<_Tp> __w, memory_order, memory_order)
                                       shared_ptr<_Tp> __w, memory_order, memory_order)

+ 9 - 7
include/new

@@ -146,9 +146,8 @@ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec
 
 
 #if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
 #if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
 
 
-class _LIBCPP_EXCEPTION_ABI bad_array_length
-    : public bad_alloc
-{
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+    bad_array_length : public bad_alloc {
 public:
 public:
     bad_array_length() _NOEXCEPT;
     bad_array_length() _NOEXCEPT;
     virtual ~bad_array_length() _NOEXCEPT;
     virtual ~bad_array_length() _NOEXCEPT;
@@ -182,7 +181,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::not
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 #endif
 
 
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
@@ -190,7 +189,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::n
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 #endif
 
 
 #ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
 #ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
@@ -199,7 +198,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 #endif
 
 
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
@@ -207,7 +206,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_v
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 #endif
 #endif
 #endif
 
 
@@ -238,6 +237,9 @@ inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void *__ptr) {
 
 
 #ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
 #ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#endif
 void __throw_bad_array_length()
 void __throw_bad_array_length()
 {
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
 #ifndef _LIBCPP_NO_EXCEPTIONS

+ 2 - 0
include/ostream

@@ -1080,8 +1080,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
                          use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
                          use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
 }
 }
 
 
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
+#endif
 
 
 _LIBCPP_END_NAMESPACE_STD
 _LIBCPP_END_NAMESPACE_STD
 
 

+ 3 - 3
include/shared_mutex

@@ -141,7 +141,7 @@ template <class Mutex>
 
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 
-struct _LIBCPP_TYPE_VIS __shared_mutex_base
+struct _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX __shared_mutex_base
 {
 {
     mutex               __mut_;
     mutex               __mut_;
     condition_variable  __gate1_;
     condition_variable  __gate1_;
@@ -173,7 +173,7 @@ struct _LIBCPP_TYPE_VIS __shared_mutex_base
 
 
 
 
 #if _LIBCPP_STD_VER > 14
 #if _LIBCPP_STD_VER > 14
-class _LIBCPP_TYPE_VIS shared_mutex
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
 {
 {
     __shared_mutex_base __base;
     __shared_mutex_base __base;
 public:
 public:
@@ -199,7 +199,7 @@ public:
 #endif
 #endif
 
 
 
 
-class _LIBCPP_TYPE_VIS shared_timed_mutex
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
 {
 {
     __shared_mutex_base __base;
     __shared_mutex_base __base;
 public:
 public:

+ 2 - 0
include/streambuf

@@ -476,11 +476,13 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
     return traits_type::eof();
     return traits_type::eof();
 }
 }
 
 
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
 
 
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
+#endif
 
 
 _LIBCPP_END_NAMESPACE_STD
 _LIBCPP_END_NAMESPACE_STD
 
 

+ 1 - 0
include/typeinfo

@@ -108,6 +108,7 @@ protected:
 #endif
 #endif
 
 
 public:
 public:
+    _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
     virtual ~type_info();
     virtual ~type_info();
 
 
 #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
 #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)

+ 2 - 0
test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp

@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // <list>
 // <list>
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
 
 
 // list(list&& c);
 // list(list&& c);
 
 

+ 3 - 0
test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp

@@ -9,6 +9,9 @@
 
 
 // UNSUPPORTED: c++98, c++03
 // UNSUPPORTED: c++98, c++03
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // list(list&& c);
 // list(list&& c);

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp

@@ -9,6 +9,9 @@
 
 
 // UNSUPPORTED: c++98, c++03
 // UNSUPPORTED: c++98, c++03
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // template <class... Args> void emplace(const_iterator p, Args&&... args);
 // template <class... Args> void emplace(const_iterator p, Args&&... args);

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator position) with end()
 // Call erase(const_iterator position) with end()

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator position) with iterator from another container
 // Call erase(const_iterator position) with iterator from another container

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator first, const_iterator last); with first iterator from another container
 // Call erase(const_iterator first, const_iterator last); with first iterator from another container

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator first, const_iterator last); with second iterator from another container
 // Call erase(const_iterator first, const_iterator last); with second iterator from another container

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator first, const_iterator last); with both iterators from another container
 // Call erase(const_iterator first, const_iterator last); with both iterators from another container

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // Call erase(const_iterator first, const_iterator last); with a bad range
 // Call erase(const_iterator first, const_iterator last); with a bad range

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // template <InputIterator Iter>
 // template <InputIterator Iter>

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // iterator insert(const_iterator position, value_type&& x);
 // iterator insert(const_iterator position, value_type&& x);

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // iterator insert(const_iterator position, size_type n, const value_type& x);
 // iterator insert(const_iterator position, size_type n, const value_type& x);

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // iterator insert(const_iterator position, const value_type& x);
 // iterator insert(const_iterator position, const value_type& x);

+ 3 - 0
test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // void pop_back();
 // void pop_back();

+ 3 - 0
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // void splice(const_iterator position, list& x);
 // void splice(const_iterator position, list& x);

+ 3 - 0
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);
 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);

+ 3 - 0
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // <list>
 // <list>
 
 
 // void splice(const_iterator position, list& x, iterator first, iterator last);
 // void splice(const_iterator position, list& x, iterator first, iterator last);

+ 3 - 0
test/libcxx/debug/containers/db_associative_container_tests.pass.cpp

@@ -12,6 +12,9 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // test container debugging
 // test container debugging
 
 
 #define _LIBCPP_DEBUG 1
 #define _LIBCPP_DEBUG 1

+ 3 - 0
test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp

@@ -12,6 +12,9 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // test container debugging
 // test container debugging
 
 
 #define _LIBCPP_DEBUG 1
 #define _LIBCPP_DEBUG 1

+ 3 - 0
test/libcxx/debug/containers/db_string.pass.cpp

@@ -12,6 +12,9 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // test container debugging
 // test container debugging
 
 
 #define _LIBCPP_DEBUG 1
 #define _LIBCPP_DEBUG 1

+ 3 - 0
test/libcxx/debug/containers/db_unord_container_tests.pass.cpp

@@ -12,6 +12,9 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // test container debugging
 // test container debugging
 
 
 #define _LIBCPP_DEBUG 1
 #define _LIBCPP_DEBUG 1

+ 3 - 0
test/libcxx/debug/debug_abort.pass.cpp

@@ -10,6 +10,9 @@
 
 
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // Test that the default debug handler aborts the program.
 // Test that the default debug handler aborts the program.
 
 
 #define _LIBCPP_DEBUG 0
 #define _LIBCPP_DEBUG 0

+ 3 - 0
test/libcxx/debug/debug_throw.pass.cpp

@@ -11,6 +11,9 @@
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-no-exceptions
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // Test that the default debug handler can be overridden and test the
 // Test that the default debug handler can be overridden and test the
 // throwing debug handler.
 // throwing debug handler.
 
 

+ 3 - 0
test/libcxx/debug/debug_throw_register.pass.cpp

@@ -12,6 +12,9 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
 
+// Can't test the system lib because this test enables debug mode
+// UNSUPPORTED: with_system_cxx_lib
+
 // Test that defining _LIBCPP_DEBUG_USE_EXCEPTIONS causes _LIBCPP_ASSERT
 // Test that defining _LIBCPP_DEBUG_USE_EXCEPTIONS causes _LIBCPP_ASSERT
 // to throw on failure.
 // to throw on failure.
 
 

+ 6 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp

@@ -8,6 +8,12 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.7
 
 
 // dynarray.cons
 // dynarray.cons
 
 

+ 1 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp

@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-no-exceptions
+// XFAIL: availability
 // dynarray.cons
 // dynarray.cons
 
 
 // explicit dynarray(size_type c);
 // explicit dynarray(size_type c);

+ 1 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp

@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
 
 
 // dynarray.data
 // dynarray.data
 
 

+ 2 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp

@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
+
 // dynarray.data
 // dynarray.data
 
 
 // void fill(const T& v);
 // void fill(const T& v);

+ 2 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp

@@ -9,6 +9,8 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-no-exceptions
+// XFAIL: availability
+
 // dynarray.overview
 // dynarray.overview
 
 
 // const_reference at(size_type n) const;
 // const_reference at(size_type n) const;

+ 2 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp

@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
+
 // dynarray.overview
 // dynarray.overview
 
 
 
 

+ 2 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp

@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
+
 // dynarray.overview
 // dynarray.overview
 
 
 // size_type size()     const noexcept;
 // size_type size()     const noexcept;

+ 1 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp

@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
 
 
 // dynarray.overview
 // dynarray.overview
 
 

+ 8 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp

@@ -8,6 +8,14 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.7
+
 // dynarray.overview
 // dynarray.overview
 
 
 // const_reference at(size_type n) const;
 // const_reference at(size_type n) const;

+ 1 - 0
test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp

@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
 // dynarray.zero
 // dynarray.zero
 
 
 // dynarray shall provide support for the special case of construction with a size of zero.
 // dynarray shall provide support for the special case of construction with a size of zero.

+ 3 - 0
test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg

@@ -0,0 +1,3 @@
+if ('availability' in config.available_features
+        and not 'libcpp-no-exceptions' in config.available_features):
+    config.unsupported = True

+ 9 - 0
test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp

@@ -8,6 +8,15 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability
+
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.7
+// XFAIL: availability=macosx10.8
+
 // test bad_array_length
 // test bad_array_length
 
 
 #include <new>
 #include <new>

+ 7 - 0
test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp

@@ -16,6 +16,13 @@
 
 
 // REQUIRES: -faligned-allocation
 // REQUIRES: -faligned-allocation
 
 
+// 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
+
 // RUN: %build -faligned-allocation
 // RUN: %build -faligned-allocation
 // RUN: %run
 // RUN: %run
 
 

+ 4 - 0
test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp

@@ -9,6 +9,10 @@
 
 
 // <strstream>
 // <strstream>
 
 
+// There was an overflow in the dylib on older macOS versions
+// UNSUPPORTED: availability=macosx10.8
+// UNSUPPORTED: availability=macosx10.7
+
 // class strstreambuf
 // class strstreambuf
 
 
 // int overflow(int c);
 // int overflow(int c);

+ 7 - 0
test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp

@@ -7,6 +7,13 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// 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
+
 // <system_error>
 // <system_error>
 
 
 // class error_category
 // class error_category

+ 7 - 0
test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp

@@ -13,6 +13,13 @@
 
 
 // const error_category& system_category();
 // const error_category& system_category();
 
 
+// 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
+
 #include <system_error>
 #include <system_error>
 #include <cassert>
 #include <cassert>
 #include <string>
 #include <string>

+ 7 - 0
test/std/experimental/any/any.class/any.assign/copy.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any& operator=(any const &);
 // any& operator=(any const &);

+ 7 - 0
test/std/experimental/any/any.class/any.assign/move.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any& operator=(any &&);
 // any& operator=(any &&);

+ 8 - 1
test/std/experimental/any/any.class/any.assign/value.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any& operator=(any const &);
 // any& operator=(any const &);
@@ -174,4 +181,4 @@ int main() {
     test_assign_throws<small_throws_on_copy>();
     test_assign_throws<small_throws_on_copy>();
     test_assign_throws<large_throws_on_copy>();
     test_assign_throws<large_throws_on_copy>();
     test_assign_throws<throws_on_move, /* Move = */ true>();
     test_assign_throws<throws_on_move, /* Move = */ true>();
-}
+}

+ 7 - 0
test/std/experimental/any/any.class/any.cons/copy.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any(any const &);
 // any(any const &);

+ 7 - 0
test/std/experimental/any/any.class/any.cons/move.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any(any &&) noexcept;
 // any(any &&) noexcept;

+ 8 - 1
test/std/experimental/any/any.class/any.cons/value.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // template <class Value> any(Value &&)
 // template <class Value> any(Value &&)
@@ -113,4 +120,4 @@ int main() {
     test_copy_value_throws<small_throws_on_copy>();
     test_copy_value_throws<small_throws_on_copy>();
     test_copy_value_throws<large_throws_on_copy>();
     test_copy_value_throws<large_throws_on_copy>();
     test_move_value_throws();
     test_move_value_throws();
-}
+}

+ 7 - 0
test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any::clear() noexcept
 // any::clear() noexcept

+ 7 - 0
test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // 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
+
 // <experimental/any>
 // <experimental/any>
 
 
 // any::swap(any &) noexcept
 // any::swap(any &) noexcept

+ 2 - 0
test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp

@@ -9,6 +9,8 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
 
 
+// XFAIL: availability=macosx
+
 // <experimental/any>
 // <experimental/any>
 
 
 // template <class ValueType>
 // template <class ValueType>

+ 1 - 1
test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp

@@ -42,4 +42,4 @@ int main() {
     any_cast<no_copy>(static_cast<any &&>(a));
     any_cast<no_copy>(static_cast<any &&>(a));
     // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}}
     // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}}
     // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}}
     // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}}
-}
+}

+ 3 - 2
test/std/experimental/any/any.nonmembers/swap.pass.cpp

@@ -34,7 +34,8 @@ int main()
 
 
         swap(a1, a2);
         swap(a1, a2);
 
 
-        assert(any_cast<int>(a1) == 2);
-        assert(any_cast<int>(a2) == 1);
+        // Support testing against system dylibs that don't have bad_any_cast.
+        assert(*any_cast<int>(&a1) == 2);
+        assert(*any_cast<int>(&a2) == 1);
     }
     }
 }
 }

+ 6 - 0
test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp

@@ -8,6 +8,12 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.7
 
 
 // <optional>
 // <optional>
 
 

+ 6 - 0
test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp

@@ -8,6 +8,12 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability_markup=macosx10.12
+// XFAIL: availability_markup=macosx10.11
+// XFAIL: availability_markup=macosx10.10
+// XFAIL: availability_markup=macosx10.9
+// XFAIL: availability_markup=macosx10.8
+// XFAIL: availability_markup=macosx10.7
 
 
 // <optional>
 // <optional>
 
 

+ 7 - 0
test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp

@@ -8,6 +8,13 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.7
+
 // <optional>
 // <optional>
 
 
 // T& optional<T>::value();
 // T& optional<T>::value();

+ 7 - 0
test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp

@@ -8,6 +8,13 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: c++98, c++03, c++11
+// XFAIL: availability=macosx10.12
+// XFAIL: availability=macosx10.11
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.7
+
 // <optional>
 // <optional>
 
 
 // constexpr const T& optional<T>::value() const;
 // constexpr const T& optional<T>::value() const;

+ 4 - 0
test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp

@@ -7,6 +7,10 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.10
+// XFAIL: with_system_cxx_lib=macosx10.9
+
 // <istream>
 // <istream>
 
 
 // template <class charT, class traits = char_traits<charT> >
 // template <class charT, class traits = char_traits<charT> >

+ 2 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp

@@ -7,6 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+
 // <istream>
 // <istream>
 
 
 // int_type get();
 // int_type get();

+ 2 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp

@@ -7,6 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+
 // <istream>
 // <istream>
 
 
 // basic_istream<charT,traits>& get(char_type& c);
 // basic_istream<charT,traits>& get(char_type& c);

+ 3 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+// XFAIL: with_system_cxx_lib=macosx10.8
+
 // <istream>
 // <istream>
 
 
 // basic_istream<charT,traits>&
 // basic_istream<charT,traits>&

+ 2 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp

@@ -7,6 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+
 // <istream>
 // <istream>
 
 
 // basic_istream<charT,traits>& read(char_type* s, streamsize n);
 // basic_istream<charT,traits>& read(char_type* s, streamsize n);

+ 3 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+// XFAIL: with_system_cxx_lib=macosx10.8
+
 // <istream>
 // <istream>
 
 
 // streamsize readsome(char_type* s, streamsize n);
 // streamsize readsome(char_type* s, streamsize n);

+ 3 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp

@@ -7,6 +7,9 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.7
+// XFAIL: with_system_cxx_lib=macosx10.8
+
 // <istream>
 // <istream>
 
 
 // basic_istream<charT,traits>& seekg(pos_type pos);
 // basic_istream<charT,traits>& seekg(pos_type pos);

+ 7 - 0
test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp

@@ -7,6 +7,13 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// 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
+
 // <istream>
 // <istream>
 
 
 // basic_istream<charT,traits>& seekg(off_type off, ios_base::seekdir dir);
 // basic_istream<charT,traits>& seekg(off_type off, ios_base::seekdir dir);

+ 2 - 0
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp

@@ -7,6 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
+// XFAIL: with_system_cxx_lib=macosx10.12
+
 // <ostream>
 // <ostream>
 
 
 // template <class charT, class traits = char_traits<charT> >
 // template <class charT, class traits = char_traits<charT> >

+ 8 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp

@@ -12,11 +12,18 @@
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
 
 
 // Older Clang versions do not support this
 // Older Clang versions do not support this
-// XFAIL: clang-3, apple-clang
+// XFAIL: clang-3, apple-clang-7, apple-clang-8
 
 
 // None of the current GCC compilers support this.
 // None of the current GCC compilers support this.
 // XFAIL: gcc
 // XFAIL: gcc
 
 
+// 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
+
 #include <new>
 #include <new>
 #include <cstddef>
 #include <cstddef>
 #include <cstdlib>
 #include <cstdlib>

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp

@@ -15,6 +15,13 @@
 // FIXME change this to XFAIL.
 // FIXME change this to XFAIL.
 // UNSUPPORTED: no-aligned-allocation
 // UNSUPPORTED: no-aligned-allocation
 
 
+// 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
+
 // test operator new
 // test operator new
 
 
 #include <new>
 #include <new>

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp

@@ -15,6 +15,13 @@
 // FIXME turn this into an XFAIL
 // FIXME turn this into an XFAIL
 // UNSUPPORTED: no-aligned-allocation
 // UNSUPPORTED: no-aligned-allocation
 
 
+// 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
+
 // test operator new (nothrow)
 // test operator new (nothrow)
 
 
 #include <new>
 #include <new>

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp

@@ -10,6 +10,13 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
 
 
+// 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: no-aligned-allocation
 // XFAIL: no-aligned-allocation
 
 
 // test operator new nothrow by replacing only operator new
 // test operator new nothrow by replacing only operator new

+ 6 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp

@@ -13,6 +13,12 @@
 // when sized deallocation is not supported, e.g., prior to C++14.
 // when sized deallocation is not supported, e.g., prior to C++14.
 
 
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
+// XFAIL: availability_markup=macosx10.11
+// XFAIL: availability_markup=macosx10.10
+// XFAIL: availability_markup=macosx10.9
+// XFAIL: availability_markup=macosx10.8
+// XFAIL: availability_markup=macosx10.7
+
 
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: fsized-deallocation
 // REQUIRES: fsized-deallocation

+ 7 - 2
test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp

@@ -10,13 +10,18 @@
 // test aligned operator delete replacement.
 // test aligned operator delete replacement.
 
 
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
-
 // Older Clang versions do not support this
 // Older Clang versions do not support this
-// XFAIL: clang-3, apple-clang
+// XFAIL: clang-3, apple-clang-7, apple-clang-8
 
 
 // None of the current GCC compilers support this.
 // None of the current GCC compilers support this.
 // XFAIL: gcc
 // XFAIL: gcc
 
 
+// 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
 
 
 #include <new>
 #include <new>
 #include <cstddef>
 #include <cstddef>

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
 
+// 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
+
 // asan and msan will not call the new handler.
 // asan and msan will not call the new handler.
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
 
 

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp

@@ -9,6 +9,13 @@
 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
 
+// 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
+
 // asan and msan will not call the new handler.
 // asan and msan will not call the new handler.
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
 
 

+ 7 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp

@@ -10,6 +10,13 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
 
 
+// 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: no-aligned-allocation
 // XFAIL: no-aligned-allocation
 
 
 // test operator new nothrow by replacing only operator new
 // test operator new nothrow by replacing only operator new

+ 5 - 0
test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp

@@ -13,6 +13,11 @@
 // when sized deallocation is not supported, e.g., prior to C++14.
 // when sized deallocation is not supported, e.g., prior to C++14.
 
 
 // UNSUPPORTED: sanitizer-new-delete
 // UNSUPPORTED: sanitizer-new-delete
+// XFAIL: availability_markup=macosx10.11
+// XFAIL: availability_markup=macosx10.10
+// XFAIL: availability_markup=macosx10.9
+// XFAIL: availability_markup=macosx10.8
+// XFAIL: availability_markup=macosx10.7
 
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: fsized-deallocation
 // REQUIRES: fsized-deallocation

+ 8 - 0
test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp

@@ -8,6 +8,14 @@
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 
 
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-no-exceptions
+// XFAIL: libcpp-no-exceptions
+
+// XFAIL: availability=macosx10.7
+// XFAIL: availability=macosx10.8
+// XFAIL: availability=macosx10.9
+// XFAIL: availability=macosx10.10
+// XFAIL: availability=macosx10.11
+
 // test uncaught_exceptions
 // test uncaught_exceptions
 
 
 #include <exception>
 #include <exception>

+ 2 - 2
test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp

@@ -9,8 +9,8 @@
 //
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
+// XFAIL: with_system_cxx_lib=macosx10.7
+// XFAIL: with_system_cxx_lib=macosx10.8
 
 
 // <locale>
 // <locale>
 
 

+ 0 - 3
test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp

@@ -15,9 +15,6 @@
 
 
 // charT tolower(charT) const;
 // charT tolower(charT) const;
 
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
-
 #include <locale>
 #include <locale>
 #include <cassert>
 #include <cassert>
 
 

+ 0 - 3
test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp

@@ -15,9 +15,6 @@
 
 
 // const charT* tolower(charT* low, const charT* high) const;
 // const charT* tolower(charT* low, const charT* high) const;
 
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
-
 #include <locale>
 #include <locale>
 #include <string>
 #include <string>
 #include <cassert>
 #include <cassert>

+ 0 - 3
test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp

@@ -15,9 +15,6 @@
 
 
 // charT toupper(charT) const;
 // charT toupper(charT) const;
 
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
-
 
 
 #include <locale>
 #include <locale>
 #include <cassert>
 #include <cassert>

+ 0 - 3
test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp

@@ -15,9 +15,6 @@
 
 
 // const charT* toupper(charT* low, const charT* high) const;
 // const charT* toupper(charT* low, const charT* high) const;
 
 
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
-
 #include <locale>
 #include <locale>
 #include <string>
 #include <string>
 #include <cassert>
 #include <cassert>

+ 2 - 1
test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp

@@ -7,7 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-// XFAIL: apple-darwin
+// This test is passing in an uncontrolled manner in some Apple environment.
+// UNSUPPORTED: apple-darwin
 
 
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // and U002E as mon_decimal_point.
 // and U002E as mon_decimal_point.

+ 2 - 1
test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp

@@ -7,7 +7,8 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-// XFAIL: apple-darwin
+// This test is passing in an uncontrolled manner in some Apple environment.
+// UNSUPPORTED: apple-darwin
 
 
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // and U002E as mon_decimal_point.
 // and U002E as mon_decimal_point.

+ 2 - 2
test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp

@@ -9,8 +9,8 @@
 //
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
+// XFAIL: with_system_cxx_lib=macosx10.7
+// XFAIL: with_system_cxx_lib=macosx10.8
 
 
 // <locale>
 // <locale>
 
 

+ 4 - 2
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp

@@ -7,8 +7,10 @@
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
 //
 //
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.7
-// XFAIL: with_system_cxx_lib=x86_64-apple-macosx10.8
+// PR11871
+// XFAIL: with_system_cxx_lib=macosx10.7
+// PR15445
+// XFAIL: with_system_cxx_lib=macosx10.8
 
 
 // <locale>
 // <locale>
 
 

+ 15 - 0
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp

@@ -6,6 +6,9 @@
 // Source Licenses. See LICENSE.TXT for details.
 // Source Licenses. See LICENSE.TXT for details.
 //
 //
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
+//
+// PR11871
+// XFAIL: with_system_cxx_lib=macosx10.7
 
 
 // <locale>
 // <locale>
 
 
@@ -194,4 +197,16 @@ int main()
         assert(v == -HUGE_VALF);
         assert(v == -HUGE_VALF);
 
 
     }
     }
+    {
+        v = -1;
+        const char str[] = "2-";
+        std::ios_base::iostate err = ios.goodbit;
+        input_iterator<const char*> iter =
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, v);
+        assert(iter.base() == str+1);
+        assert(err == ios.goodbit);
+        assert(v == 2);
+    }
 }
 }

Some files were not shown because too many files changed in this diff