\#964 Delete JSONCPP_NORETURN for [[noreturn]]

This patch removes the custom JSONCPP_NORETURN macro in favor of the
C++11 standard [[noreturn]] attribute.
This commit is contained in:
Jordan Bayles
2019-07-09 15:03:39 -07:00
parent 60ba071aac
commit 9ef812a097
2 changed files with 6 additions and 19 deletions

View File

@@ -232,15 +232,15 @@ Exception::~Exception() JSONCPP_NOEXCEPT {}
char const* Exception::what() const JSONCPP_NOEXCEPT { return msg_.c_str(); }
RuntimeError::RuntimeError(String const& msg) : Exception(msg) {}
LogicError::LogicError(String const& msg) : Exception(msg) {}
JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
[[noreturn]] void throwRuntimeError(String const& msg) {
throw RuntimeError(msg);
}
JSONCPP_NORETURN void throwLogicError(String const& msg) {
[[noreturn]] void throwLogicError(String const& msg) {
throw LogicError(msg);
}
#else // !JSON_USE_EXCEPTION
JSONCPP_NORETURN void throwRuntimeError(String const& msg) { abort(); }
JSONCPP_NORETURN void throwLogicError(String const& msg) { abort(); }
[[noreturn]] void throwRuntimeError(String const& msg) { abort(); }
[[noreturn]] void throwLogicError(String const& msg) { abort(); }
#endif
// //////////////////////////////////////////////////////////////////