Commit 11d5c863 authored by Eric Niebler's avatar Eric Niebler Committed by Facebook Github Bot

Mark exception_wrapper constructor as noexcept

Summary: Constructing an `exception_wrapper` from an `std::exception_ptr` and a reference to an exception could never throw an exception, but was not marked `noexcept`. So annotate it.

Reviewed By: yfeldblum, lewissbaker

Differential Revision: D9351489

fbshipit-source-id: 858299330b376360fc6420b6c901ab846d577854
parent a05e75b7
......@@ -99,7 +99,7 @@ static_assert(
inline std::uintptr_t exception_wrapper::ExceptionPtr::as_int_(
std::exception_ptr const& ptr,
std::exception const& e) {
std::exception const& e) noexcept {
if (!kMicrosoftAbiVer) {
return reinterpret_cast<std::uintptr_t>(&e);
} else {
......@@ -130,7 +130,7 @@ inline std::uintptr_t exception_wrapper::ExceptionPtr::as_int_(
}
inline std::uintptr_t exception_wrapper::ExceptionPtr::as_int_(
std::exception_ptr const&,
AnyException e) {
AnyException e) noexcept {
return reinterpret_cast<std::uintptr_t>(e.typeinfo_) + 1;
}
inline bool exception_wrapper::ExceptionPtr::has_exception_() const {
......@@ -333,7 +333,8 @@ inline exception_wrapper::~exception_wrapper() {
}
template <class Ex>
inline exception_wrapper::exception_wrapper(std::exception_ptr ptr, Ex& ex)
inline
exception_wrapper::exception_wrapper(std::exception_ptr ptr, Ex& ex) noexcept
: eptr_{ptr, ExceptionPtr::as_int_(ptr, ex)},
vptr_(&ExceptionPtr::ops_) {
assert(eptr_.ptr_);
......
......@@ -264,10 +264,10 @@ class exception_wrapper final {
static std::uintptr_t as_int_(
std::exception_ptr const& ptr,
std::exception const& e);
std::exception const& e) noexcept;
static std::uintptr_t as_int_(
std::exception_ptr const& ptr,
AnyException e);
AnyException e) noexcept;
bool has_exception_() const;
std::exception const* as_exception_() const;
std::type_info const* as_type_() const;
......@@ -418,7 +418,7 @@ class exception_wrapper final {
//! \post `bool(*this)`
//! \post `type() == typeid(ex)`
template <class Ex>
exception_wrapper(std::exception_ptr ptr, Ex& ex);
exception_wrapper(std::exception_ptr ptr, Ex& ex) noexcept;
//! \pre `typeid(ex) == typeid(typename decay<Ex>::type)`
//! \post `bool(*this)`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment