Commit 4e5b3630 authored by Sergey Anpilov's avatar Sergey Anpilov Committed by Facebook Github Bot

Make folly.TypeError compatible with -Wdeprecated

Summary: Starting with C++11, implicit generation of copy/move constructors/operators in presence of user-defined destructors/constructors/operators is deprecated

Reviewed By: yfeldblum

Differential Revision: D6875337

fbshipit-source-id: a623a3ce2e7f5559d2de2324565c8995682085c7
parent e7e82040
......@@ -82,6 +82,16 @@ struct FOLLY_EXPORT TypeError : std::runtime_error {
const std::string& expected,
dynamic::Type actual1,
dynamic::Type actual2);
// TODO: noexcept calculation required through gcc-v4.9; remove once upgrading
// to gcc-v5.
TypeError(const TypeError&) noexcept(
std::is_nothrow_copy_constructible<std::runtime_error>::value);
TypeError& operator=(const TypeError&) noexcept(
std::is_nothrow_copy_assignable<std::runtime_error>::value);
TypeError(TypeError&&) noexcept(
std::is_nothrow_move_constructible<std::runtime_error>::value);
TypeError& operator=(TypeError&&) noexcept(
std::is_nothrow_move_assignable<std::runtime_error>::value);
~TypeError() override;
};
......
......@@ -60,6 +60,14 @@ TypeError::TypeError(
dynamic::typeName(actual1),
dynamic::typeName(actual2))) {}
TypeError::TypeError(const TypeError&) noexcept(
std::is_nothrow_copy_constructible<std::runtime_error>::value) = default;
TypeError& TypeError::operator=(const TypeError&) noexcept(
std::is_nothrow_copy_assignable<std::runtime_error>::value) = default;
TypeError::TypeError(TypeError&&) noexcept(
std::is_nothrow_move_constructible<std::runtime_error>::value) = default;
TypeError& TypeError::operator=(TypeError&&) noexcept(
std::is_nothrow_move_assignable<std::runtime_error>::value) = default;
TypeError::~TypeError() = default;
[[noreturn]] void throwTypeError_(
......
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