weimingz created this revision.
weimingz added a subscriber: cfe-commits.

this fixes build error when built with c++14 and no exceptions

http://reviews.llvm.org/D21673

Files:
  include/experimental/optional

Index: include/experimental/optional
===================================================================
--- include/experimental/optional
+++ include/experimental/optional
@@ -517,7 +517,11 @@
     constexpr value_type const& value() const
     {
         if (!this->__engaged_)
+#ifndef _LIBCPP_NO_EXCEPTIONS
             throw bad_optional_access();
+#else
+            assert(!"bad optional access");
+#endif
         return this->__val_;
     }
 
@@ -525,7 +529,11 @@
     value_type& value()
     {
         if (!this->__engaged_)
+#ifndef _LIBCPP_NO_EXCEPTIONS
             throw bad_optional_access();
+#else
+            assert(!"bad optional access");
+#endif
         return this->__val_;
     }
 


Index: include/experimental/optional
===================================================================
--- include/experimental/optional
+++ include/experimental/optional
@@ -517,7 +517,11 @@
     constexpr value_type const& value() const
     {
         if (!this->__engaged_)
+#ifndef _LIBCPP_NO_EXCEPTIONS
             throw bad_optional_access();
+#else
+            assert(!"bad optional access");
+#endif
         return this->__val_;
     }
 
@@ -525,7 +529,11 @@
     value_type& value()
     {
         if (!this->__engaged_)
+#ifndef _LIBCPP_NO_EXCEPTIONS
             throw bad_optional_access();
+#else
+            assert(!"bad optional access");
+#endif
         return this->__val_;
     }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to