Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
0f20ddcd
Commit
0f20ddcd
authored
Dec 03, 2016
by
Jens Breitbart
Committed by
Jesse Beder
Dec 03, 2016
Browse files
Fix -Wweak-vtables warnings in exception classes.
parent
d0250400
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
include/yaml-cpp/exceptions.h
include/yaml-cpp/exceptions.h
+14
-2
src/exceptions.cpp
src/exceptions.cpp
+19
-0
No files found.
include/yaml-cpp/exceptions.h
View file @
0f20ddcd
...
...
@@ -9,9 +9,9 @@
#include "yaml-cpp/mark.h"
#include "yaml-cpp/traits.h"
#include <sstream>
#include <stdexcept>
#include <string>
#include <sstream>
namespace
YAML
{
// error messages
...
...
@@ -112,7 +112,7 @@ class 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
;
...
...
@@ -137,12 +137,14 @@ class ParserException : public Exception {
public:
ParserException
(
const
Mark
&
mark_
,
const
std
::
string
&
msg_
)
:
Exception
(
mark_
,
msg_
)
{}
virtual
~
ParserException
()
noexcept
;
};
class
RepresentationException
:
public
Exception
{
public:
RepresentationException
(
const
Mark
&
mark_
,
const
std
::
string
&
msg_
)
:
Exception
(
mark_
,
msg_
)
{}
virtual
~
RepresentationException
()
noexcept
;
};
// representation exceptions
...
...
@@ -150,6 +152,7 @@ class InvalidScalar : public RepresentationException {
public:
InvalidScalar
(
const
Mark
&
mark_
)
:
RepresentationException
(
mark_
,
ErrorMsg
::
INVALID_SCALAR
)
{}
virtual
~
InvalidScalar
()
noexcept
;
};
class
KeyNotFound
:
public
RepresentationException
{
...
...
@@ -158,6 +161,7 @@ class KeyNotFound : public RepresentationException {
KeyNotFound
(
const
Mark
&
mark_
,
const
T
&
key_
)
:
RepresentationException
(
mark_
,
ErrorMsg
::
KEY_NOT_FOUND_WITH_KEY
(
key_
))
{
}
virtual
~
KeyNotFound
()
noexcept
;
};
template
<
typename
T
>
...
...
@@ -180,12 +184,14 @@ class InvalidNode : public RepresentationException {
public:
InvalidNode
()
:
RepresentationException
(
Mark
::
null_mark
(),
ErrorMsg
::
INVALID_NODE
)
{}
virtual
~
InvalidNode
()
noexcept
;
};
class
BadConversion
:
public
RepresentationException
{
public:
explicit
BadConversion
(
const
Mark
&
mark_
)
:
RepresentationException
(
mark_
,
ErrorMsg
::
BAD_CONVERSION
)
{}
virtual
~
BadConversion
()
noexcept
;
};
template
<
typename
T
>
...
...
@@ -198,35 +204,41 @@ class BadDereference : public RepresentationException {
public:
BadDereference
()
:
RepresentationException
(
Mark
::
null_mark
(),
ErrorMsg
::
BAD_DEREFERENCE
)
{}
virtual
~
BadDereference
()
noexcept
;
};
class
BadSubscript
:
public
RepresentationException
{
public:
BadSubscript
()
:
RepresentationException
(
Mark
::
null_mark
(),
ErrorMsg
::
BAD_SUBSCRIPT
)
{}
virtual
~
BadSubscript
()
noexcept
;
};
class
BadPushback
:
public
RepresentationException
{
public:
BadPushback
()
:
RepresentationException
(
Mark
::
null_mark
(),
ErrorMsg
::
BAD_PUSHBACK
)
{}
virtual
~
BadPushback
()
noexcept
;
};
class
BadInsert
:
public
RepresentationException
{
public:
BadInsert
()
:
RepresentationException
(
Mark
::
null_mark
(),
ErrorMsg
::
BAD_INSERT
)
{}
virtual
~
BadInsert
()
noexcept
;
};
class
EmitterException
:
public
Exception
{
public:
EmitterException
(
const
std
::
string
&
msg_
)
:
Exception
(
Mark
::
null_mark
(),
msg_
)
{}
virtual
~
EmitterException
()
noexcept
;
};
class
BadFile
:
public
Exception
{
public:
BadFile
()
:
Exception
(
Mark
::
null_mark
(),
ErrorMsg
::
BAD_FILE
)
{}
virtual
~
BadFile
()
noexcept
;
};
}
...
...
src/exceptions.cpp
0 → 100644
View file @
0f20ddcd
#include "yaml-cpp/exceptions.h"
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
{}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment