Merge da807adc99 into efbfa1c7c7
This commit is contained in:
commit
147a4e0e3d
@ -17,7 +17,7 @@ Commit messages should be in the imperative mood, as described in the [Git contr
|
||||
|
||||
# Tests
|
||||
|
||||
Please verify the tests pass by running the target `tests/run_tests`.
|
||||
Please verify the tests pass by running the target `test/run-tests`.
|
||||
|
||||
If you are adding functionality, add tests accordingly.
|
||||
|
||||
|
||||
@ -7,6 +7,18 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef NOEXCEPT
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _NOEXCEPT
|
||||
#define NOEXCEPT _NOEXCEPT
|
||||
#else
|
||||
#define NOEXCEPT
|
||||
#endif // ifdef _NOEXCEPT
|
||||
#else
|
||||
#define NOEXCEPT noexcept
|
||||
#endif // ifdef _MSC_VER
|
||||
#endif // ifdef NOEXCEPT
|
||||
|
||||
#include "yaml-cpp/mark.h"
|
||||
#include "yaml-cpp/traits.h"
|
||||
#include <sstream>
|
||||
@ -112,7 +124,7 @@ class YAML_CPP_API Exception : public std::runtime_error {
|
||||
public:
|
||||
Exception(const Mark& mark_, const std::string& msg_)
|
||||
: std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
|
||||
virtual ~Exception() noexcept;
|
||||
virtual ~Exception() NOEXCEPT;
|
||||
|
||||
Exception(const Exception&) = default;
|
||||
|
||||
@ -138,7 +150,7 @@ class YAML_CPP_API ParserException : public Exception {
|
||||
ParserException(const Mark& mark_, const std::string& msg_)
|
||||
: Exception(mark_, msg_) {}
|
||||
ParserException(const ParserException&) = default;
|
||||
virtual ~ParserException() noexcept;
|
||||
virtual ~ParserException() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API RepresentationException : public Exception {
|
||||
@ -146,7 +158,7 @@ class YAML_CPP_API RepresentationException : public Exception {
|
||||
RepresentationException(const Mark& mark_, const std::string& msg_)
|
||||
: Exception(mark_, msg_) {}
|
||||
RepresentationException(const RepresentationException&) = default;
|
||||
virtual ~RepresentationException() noexcept;
|
||||
virtual ~RepresentationException() NOEXCEPT;
|
||||
};
|
||||
|
||||
// representation exceptions
|
||||
@ -155,7 +167,7 @@ class YAML_CPP_API InvalidScalar : public RepresentationException {
|
||||
InvalidScalar(const Mark& mark_)
|
||||
: RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {}
|
||||
InvalidScalar(const InvalidScalar&) = default;
|
||||
virtual ~InvalidScalar() noexcept;
|
||||
virtual ~InvalidScalar() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API KeyNotFound : public RepresentationException {
|
||||
@ -165,7 +177,7 @@ class YAML_CPP_API KeyNotFound : public RepresentationException {
|
||||
: RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) {
|
||||
}
|
||||
KeyNotFound(const KeyNotFound&) = default;
|
||||
virtual ~KeyNotFound() noexcept;
|
||||
virtual ~KeyNotFound() NOEXCEPT;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -173,7 +185,7 @@ class YAML_CPP_API TypedKeyNotFound : public KeyNotFound {
|
||||
public:
|
||||
TypedKeyNotFound(const Mark& mark_, const T& key_)
|
||||
: KeyNotFound(mark_, key_), key(key_) {}
|
||||
virtual ~TypedKeyNotFound() noexcept {}
|
||||
virtual ~TypedKeyNotFound() NOEXCEPT {}
|
||||
|
||||
T key;
|
||||
};
|
||||
@ -189,7 +201,7 @@ class YAML_CPP_API InvalidNode : public RepresentationException {
|
||||
InvalidNode()
|
||||
: RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {}
|
||||
InvalidNode(const InvalidNode&) = default;
|
||||
virtual ~InvalidNode() noexcept;
|
||||
virtual ~InvalidNode() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API BadConversion : public RepresentationException {
|
||||
@ -197,7 +209,7 @@ class YAML_CPP_API BadConversion : public RepresentationException {
|
||||
explicit BadConversion(const Mark& mark_)
|
||||
: RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {}
|
||||
BadConversion(const BadConversion&) = default;
|
||||
virtual ~BadConversion() noexcept;
|
||||
virtual ~BadConversion() NOEXCEPT;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -211,7 +223,7 @@ class YAML_CPP_API BadDereference : public RepresentationException {
|
||||
BadDereference()
|
||||
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {}
|
||||
BadDereference(const BadDereference&) = default;
|
||||
virtual ~BadDereference() noexcept;
|
||||
virtual ~BadDereference() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API BadSubscript : public RepresentationException {
|
||||
@ -219,7 +231,7 @@ class YAML_CPP_API BadSubscript : public RepresentationException {
|
||||
BadSubscript()
|
||||
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {}
|
||||
BadSubscript(const BadSubscript&) = default;
|
||||
virtual ~BadSubscript() noexcept;
|
||||
virtual ~BadSubscript() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API BadPushback : public RepresentationException {
|
||||
@ -227,7 +239,7 @@ class YAML_CPP_API BadPushback : public RepresentationException {
|
||||
BadPushback()
|
||||
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {}
|
||||
BadPushback(const BadPushback&) = default;
|
||||
virtual ~BadPushback() noexcept;
|
||||
virtual ~BadPushback() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API BadInsert : public RepresentationException {
|
||||
@ -235,7 +247,7 @@ class YAML_CPP_API BadInsert : public RepresentationException {
|
||||
BadInsert()
|
||||
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {}
|
||||
BadInsert(const BadInsert&) = default;
|
||||
virtual ~BadInsert() noexcept;
|
||||
virtual ~BadInsert() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API EmitterException : public Exception {
|
||||
@ -243,14 +255,14 @@ class YAML_CPP_API EmitterException : public Exception {
|
||||
EmitterException(const std::string& msg_)
|
||||
: Exception(Mark::null_mark(), msg_) {}
|
||||
EmitterException(const EmitterException&) = default;
|
||||
virtual ~EmitterException() noexcept;
|
||||
virtual ~EmitterException() NOEXCEPT;
|
||||
};
|
||||
|
||||
class YAML_CPP_API BadFile : public Exception {
|
||||
public:
|
||||
BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {}
|
||||
BadFile(const BadFile&) = default;
|
||||
virtual ~BadFile() noexcept;
|
||||
virtual ~BadFile() NOEXCEPT;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -3,17 +3,17 @@
|
||||
namespace YAML {
|
||||
|
||||
// These destructors are defined out-of-line so the vtable is only emitted once.
|
||||
Exception::~Exception() noexcept {}
|
||||
ParserException::~ParserException() noexcept {}
|
||||
RepresentationException::~RepresentationException() noexcept {}
|
||||
InvalidScalar::~InvalidScalar() noexcept {}
|
||||
KeyNotFound::~KeyNotFound() noexcept {}
|
||||
InvalidNode::~InvalidNode() noexcept {}
|
||||
BadConversion::~BadConversion() noexcept {}
|
||||
BadDereference::~BadDereference() noexcept {}
|
||||
BadSubscript::~BadSubscript() noexcept {}
|
||||
BadPushback::~BadPushback() noexcept {}
|
||||
BadInsert::~BadInsert() noexcept {}
|
||||
EmitterException::~EmitterException() noexcept {}
|
||||
BadFile::~BadFile() noexcept {}
|
||||
Exception::~Exception() NOEXCEPT {}
|
||||
ParserException::~ParserException() NOEXCEPT {}
|
||||
RepresentationException::~RepresentationException() NOEXCEPT {}
|
||||
InvalidScalar::~InvalidScalar() NOEXCEPT {}
|
||||
KeyNotFound::~KeyNotFound() NOEXCEPT {}
|
||||
InvalidNode::~InvalidNode() NOEXCEPT {}
|
||||
BadConversion::~BadConversion() NOEXCEPT {}
|
||||
BadDereference::~BadDereference() NOEXCEPT {}
|
||||
BadSubscript::~BadSubscript() NOEXCEPT {}
|
||||
BadPushback::~BadPushback() NOEXCEPT {}
|
||||
BadInsert::~BadInsert() NOEXCEPT {}
|
||||
EmitterException::~EmitterException() NOEXCEPT {}
|
||||
BadFile::~BadFile() NOEXCEPT {}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user