Skip to content

Commit

Permalink
Fix warning: catching polymorphic type ‘class Grantlee::Exception’ by…
Browse files Browse the repository at this point in the history
… value [-Wcatch-value=]
  • Loading branch information
Montel authored and steveire committed Apr 15, 2019
1 parent 3cb4bd2 commit 474472c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/defaulttags/if.cpp
Expand Up @@ -92,7 +92,7 @@ void IfNode::render(OutputStream *stream, Context *c) const
if (pair.first) {
try {
match = Grantlee::variantIsTrue(pair.first->evaluate(c));
} catch (Grantlee::Exception) {
} catch (const Grantlee::Exception &) {
}
} else {
match = true;
Expand Down
2 changes: 1 addition & 1 deletion templates/defaulttags/if_p.h
Expand Up @@ -321,7 +321,7 @@ QVariant IfToken::evaluate(Context *c) const
Q_ASSERT(!"Invalid OpCode");
return QVariant();
}
} catch (Grantlee::Exception) {
} catch (const Grantlee::Exception &) {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions templates/lib/parser.cpp
Expand Up @@ -205,7 +205,7 @@ NodeList ParserPrivate::parse(QObject *parent, const QStringList &stopAt)
FilterExpression filterExpression;
try {
filterExpression = FilterExpression(token.content, q);
} catch (Grantlee::Exception e) {
} catch (const Grantlee::Exception &e) {
throw Grantlee::Exception(e.errorCode(),
QStringLiteral("%1, line %2, %3")
.arg(e.what())
Expand Down Expand Up @@ -247,7 +247,7 @@ NodeList ParserPrivate::parse(QObject *parent, const QStringList &stopAt)
Node *n;
try {
n = nodeFactory->getNode(token.content, q);
} catch (Grantlee::Exception e) {
} catch (const Grantlee::Exception &e) {
throw Grantlee::Exception(e.errorCode(),
QStringLiteral("%1, line %2, %3")
.arg(e.what())
Expand Down

0 comments on commit 474472c

Please sign in to comment.