Fix some clang warnings (#378)

* Remove extra semicolon

* Fix automatic type conversion

* Replace dynamic exception specifications by C++11 noexcept

* Fix deprecated definition of implicit copy constructor for 'Exception'
This commit is contained in:
Vincent Cogne
2016-06-13 05:10:14 +02:00
committed by Jesse Beder
parent 7c33b3cdab
commit f74ae543b4
3 changed files with 7 additions and 5 deletions

View File

@@ -162,12 +162,12 @@ inline Emitter& Emitter::WriteStreamable(T value) {
template <> template <>
inline void Emitter::SetStreamablePrecision<float>(std::stringstream& stream) { inline void Emitter::SetStreamablePrecision<float>(std::stringstream& stream) {
stream.precision(GetFloatPrecision()); stream.precision(static_cast<std::streamsize>(GetFloatPrecision()));
} }
template <> template <>
inline void Emitter::SetStreamablePrecision<double>(std::stringstream& stream) { inline void Emitter::SetStreamablePrecision<double>(std::stringstream& stream) {
stream.precision(GetDoublePrecision()); stream.precision(static_cast<std::streamsize>(GetDoublePrecision()));
} }
// overloads of insertion // overloads of insertion

View File

@@ -112,7 +112,9 @@ class Exception : public std::runtime_error {
public: public:
Exception(const Mark& mark_, const std::string& msg_) Exception(const Mark& mark_, const std::string& msg_)
: std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
virtual ~Exception() throw() {} virtual ~Exception() noexcept {}
Exception(const Exception&) = default;
Mark mark; Mark mark;
std::string msg; std::string msg;
@@ -163,7 +165,7 @@ class TypedKeyNotFound : public KeyNotFound {
public: public:
TypedKeyNotFound(const Mark& mark_, const T& key_) TypedKeyNotFound(const Mark& mark_, const T& key_)
: KeyNotFound(mark_, key_), key(key_) {} : KeyNotFound(mark_, key_), key(key_) {}
virtual ~TypedKeyNotFound() throw() {} virtual ~TypedKeyNotFound() noexcept {}
T key; T key;
}; };

View File

@@ -58,7 +58,7 @@ class YAML_CPP_API Node {
bool IsMap() const { return Type() == NodeType::Map; } bool IsMap() const { return Type() == NodeType::Map; }
// bool conversions // bool conversions
YAML_CPP_OPERATOR_BOOL(); YAML_CPP_OPERATOR_BOOL()
bool operator!() const { return !IsDefined(); } bool operator!() const { return !IsDefined(); }
// access // access