Commit 1e274dc6 authored by Phil Willoughby's avatar Phil Willoughby Committed by Facebook Github Bot

don't throw in noexcept function

Summary:
`throw` within a `noexcept` function triggers a compiler warning on the latest clang in C++17 mode.

As the behavior of uncaught `throw` within a `noexcept` context is to terminate the program, do so explicitly.

Reviewed By: yfeldblum

Differential Revision: D8651221

fbshipit-source-id: 004c4c132ad9b5b873a92cf2710b9d1ebe4e705b
parent 78cd0ec8
...@@ -227,6 +227,7 @@ ...@@ -227,6 +227,7 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/functional/Invoke.h> #include <folly/functional/Invoke.h>
#include <folly/lang/Exception.h>
namespace folly { namespace folly {
...@@ -414,7 +415,7 @@ struct FunctionTraits<ReturnType(Args...) noexcept> { ...@@ -414,7 +415,7 @@ struct FunctionTraits<ReturnType(Args...) noexcept> {
} }
static ReturnType uninitCall(Data&, Args&&...) noexcept { static ReturnType uninitCall(Data&, Args&&...) noexcept {
throw std::bad_function_call(); terminate_with<std::bad_function_call>();
} }
ReturnType operator()(Args... args) noexcept { ReturnType operator()(Args... args) noexcept {
......
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