[libcxx] Add availability markup for bad_optional_access, bad_variant_access and bad_any_cast

Reviewers: dexonsmith, EricWF

Subscribers: christof, arphaman, libcxx-commits

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

llvm-svn: 347219
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 8a063df19435af25eadd30734be1b76275cbb56b
diff --git a/include/optional b/include/optional
index 9ef0aac..544140f 100644
--- a/include/optional
+++ b/include/optional
@@ -169,7 +169,7 @@
 namespace std  // purposefully not using versioning namespace
 {
 
-class _LIBCPP_EXCEPTION_ABI bad_optional_access
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
     : public exception
 {
 public:
@@ -186,6 +186,7 @@
 
 _LIBCPP_NORETURN
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
 void __throw_bad_optional_access() {
 #ifndef _LIBCPP_NO_EXCEPTIONS
         throw bad_optional_access();
@@ -933,6 +934,7 @@
     using __base::__get;
 
     _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type const& value() const&
     {
         if (!this->has_value())
@@ -941,6 +943,7 @@
     }
 
     _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type& value() &
     {
         if (!this->has_value())
@@ -949,6 +952,7 @@
     }
 
     _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type&& value() &&
     {
         if (!this->has_value())
@@ -957,6 +961,7 @@
     }
 
     _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type const&& value() const&&
     {
         if (!this->has_value())