This revision was automatically updated to reflect the committed changes. Closed by commit rL273697: [libcxx] guard throw with exception enabling check (authored by weimingz).
Changed prior to commit: http://reviews.llvm.org/D21673?vs=61755&id=61813#toc Repository: rL LLVM http://reviews.llvm.org/D21673 Files: libcxx/trunk/include/experimental/optional Index: libcxx/trunk/include/experimental/optional =================================================================== --- libcxx/trunk/include/experimental/optional +++ libcxx/trunk/include/experimental/optional @@ -517,15 +517,23 @@ 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_; } _LIBCPP_INLINE_VISIBILITY value_type& value() { if (!this->__engaged_) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_optional_access(); +#else + assert(!"bad optional access"); +#endif return this->__val_; }
Index: libcxx/trunk/include/experimental/optional =================================================================== --- libcxx/trunk/include/experimental/optional +++ libcxx/trunk/include/experimental/optional @@ -517,15 +517,23 @@ 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_; } _LIBCPP_INLINE_VISIBILITY 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