Permalink
Browse files

Fixed compiler warning -Wdeprecated with clang. (#452)

* Fixed compiler warning -Wdeprecated with clang.

Starting with C++11 implicit copy-constructors are deprecated when the class
has a user defined destructor.

* Fixes -Wdocumentation warning.

yaml-cpp/parser.h:50:65: warning: parameter 'eventHandler}.' not found in the function
      declaration [-Wdocumentation]
   * Handles the next document by calling events on the {@param eventHandler}.
                                                                ^~~~~~~~~~~~~~
yaml-cpp/parser.h:50:65: note: did you mean 'eventHandler'?
   * Handles the next document by calling events on the {@param eventHandler}.
                                                                ^~~~~~~~~~~~~~
                                                                eventHandler
  • Loading branch information...
1 parent f828610 commit 86c69bb73c497bd127afd9802d0aef8ba160f9c6 @jbreitbart jbreitbart committed with Jan 5, 2017
Showing with 13 additions and 1 deletion.
  1. +12 −0 include/yaml-cpp/exceptions.h
  2. +1 −1 include/yaml-cpp/parser.h
@@ -137,13 +137,15 @@ class ParserException : public Exception {
public:
ParserException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
+ ParserException(const ParserException&) = default;
virtual ~ParserException() noexcept;
};
class RepresentationException : public Exception {
public:
RepresentationException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
+ RepresentationException(const RepresentationException&) = default;
virtual ~RepresentationException() noexcept;
};
@@ -152,6 +154,7 @@ class InvalidScalar : public RepresentationException {
public:
InvalidScalar(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {}
+ InvalidScalar(const InvalidScalar&) = default;
virtual ~InvalidScalar() noexcept;
};
@@ -161,6 +164,7 @@ class KeyNotFound : public RepresentationException {
KeyNotFound(const Mark& mark_, const T& key_)
: RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) {
}
+ KeyNotFound(const KeyNotFound&) = default;
virtual ~KeyNotFound() noexcept;
};
@@ -184,13 +188,15 @@ class InvalidNode : public RepresentationException {
public:
InvalidNode()
: RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {}
+ InvalidNode(const InvalidNode&) = default;
virtual ~InvalidNode() noexcept;
};
class BadConversion : public RepresentationException {
public:
explicit BadConversion(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {}
+ BadConversion(const BadConversion&) = default;
virtual ~BadConversion() noexcept;
};
@@ -204,40 +210,46 @@ class BadDereference : public RepresentationException {
public:
BadDereference()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {}
+ BadDereference(const BadDereference&) = default;
virtual ~BadDereference() noexcept;
};
class BadSubscript : public RepresentationException {
public:
BadSubscript()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {}
+ BadSubscript(const BadSubscript&) = default;
virtual ~BadSubscript() noexcept;
};
class BadPushback : public RepresentationException {
public:
BadPushback()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {}
+ BadPushback(const BadPushback&) = default;
virtual ~BadPushback() noexcept;
};
class BadInsert : public RepresentationException {
public:
BadInsert()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {}
+ BadInsert(const BadInsert&) = default;
virtual ~BadInsert() noexcept;
};
class EmitterException : public Exception {
public:
EmitterException(const std::string& msg_)
: Exception(Mark::null_mark(), msg_) {}
+ EmitterException(const EmitterException&) = default;
virtual ~EmitterException() noexcept;
};
class BadFile : public Exception {
public:
BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {}
+ BadFile(const BadFile&) = default;
virtual ~BadFile() noexcept;
};
}
@@ -47,7 +47,7 @@ class YAML_CPP_API Parser : private noncopyable {
void Load(std::istream& in);
/**
- * Handles the next document by calling events on the {@param eventHandler}.
+ * Handles the next document by calling events on the {@code eventHandler}.
*
* @throw a ParserException on error.
* @return false if there are no more documents

0 comments on commit 86c69bb

Please sign in to comment.