aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-10 16:51:58 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-24 14:50:43 +0000
commitf482270432761e72b87fb368c2a379cd59b169b3 (patch)
tree11bbf09187ef36eb23c51a55e4b6e617ed4b8cfb /src/libs
parent66488ba0b8d8fd7111e75fc53f37af4e4f51a12e (diff)
Introduce Q_FALLTHROUGH()
Silence g++ 7.X warnings. Change-Id: I9d06d04b496c9ec060e13e1be6f43d8fbadb1f3b Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp8
-rw-r--r--src/libs/qmljs/parser/qmljslexer.cpp2
-rw-r--r--src/libs/qmljs/qmljscodeformatter.cpp4
-rw-r--r--src/libs/qmljs/qmljsevaluate.cpp2
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp9
-rw-r--r--src/libs/ssh/sshchannelmanager.cpp2
-rw-r--r--src/libs/ssh/sshconnection.cpp2
7 files changed, 15 insertions, 14 deletions
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp
index 16f351077a1..3547041212e 100644
--- a/src/libs/3rdparty/cplusplus/Parser.cpp
+++ b/src/libs/3rdparty/cplusplus/Parser.cpp
@@ -2565,7 +2565,7 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node, ClassSpecifierAST *
case T_STATIC_ASSERT:
if (_languageFeatures.cxx11Enabled)
CACHE_AND_RETURN(cacheKey, parseStaticAssertDeclaration(node));
- // fall-through
+ Q_FALLTHROUGH();
default:
CACHE_AND_RETURN(cacheKey, parseSimpleDeclaration(node, declaringClass));
@@ -3830,7 +3830,7 @@ bool Parser::parseBlockDeclaration(DeclarationAST *&node)
case T_STATIC_ASSERT:
if (_languageFeatures.cxx11Enabled)
return parseStaticAssertDeclaration(node);
- // fall-through
+ Q_FALLTHROUGH();
default:
return parseSimpleDeclaration(node);
@@ -3914,7 +3914,7 @@ bool Parser::lookAtStorageClassSpecifier() const
case T_CONSTEXPR:
if (_languageFeatures.cxx11Enabled)
return true;
- // fall-through
+ Q_FALLTHROUGH();
default:
return false;
}
@@ -4514,7 +4514,7 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
case T_NULLPTR:
if (_languageFeatures.cxx11Enabled)
return parsePointerLiteral(node);
- // fall-through
+ Q_FALLTHROUGH();
case T_CHAR_LITERAL: // ### FIXME don't use NumericLiteral for chars
case T_WIDE_CHAR_LITERAL:
diff --git a/src/libs/qmljs/parser/qmljslexer.cpp b/src/libs/qmljs/parser/qmljslexer.cpp
index d24920e24d9..0fa9c748052 100644
--- a/src/libs/qmljs/parser/qmljslexer.cpp
+++ b/src/libs/qmljs/parser/qmljslexer.cpp
@@ -754,7 +754,7 @@ again:
u = QLatin1Char('\0');
break;
}
- // fall through
+ Q_FALLTHROUGH();
case '1':
case '2':
case '3':
diff --git a/src/libs/qmljs/qmljscodeformatter.cpp b/src/libs/qmljs/qmljscodeformatter.cpp
index 5d974d735b0..8c34cdc4acb 100644
--- a/src/libs/qmljs/qmljscodeformatter.cpp
+++ b/src/libs/qmljs/qmljscodeformatter.cpp
@@ -278,7 +278,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
enter(expression_continuation);
break;
}
- // fallthrough
+ Q_FALLTHROUGH();
case ternary_op_after_colon:
case expression:
if (tryInsideExpression())
@@ -1142,7 +1142,7 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
*savedIndentDepth = parentState.savedIndentDepth;
break;
}
- // fallthrough
+ Q_FALLTHROUGH();
case substatement_open:
// special case for "foo: {" and "property int foo: {"
if (parentState.type == binding_assignment)
diff --git a/src/libs/qmljs/qmljsevaluate.cpp b/src/libs/qmljs/qmljsevaluate.cpp
index 0659ee8fb19..26ba2e56b5b 100644
--- a/src/libs/qmljs/qmljsevaluate.cpp
+++ b/src/libs/qmljs/qmljsevaluate.cpp
@@ -444,7 +444,7 @@ bool Evaluate::visit(AST::BinaryExpression *ast)
//case QSOperator::And: // ### enable once implemented below
//case QSOperator::Or:
lhs = value(ast->left);
- // fallthrough
+ Q_FALLTHROUGH();
case QSOperator::Assign:
rhs = value(ast->right);
break;
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index 74fa69d8c90..b14bd39a52b 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -37,6 +37,7 @@
#include <cplusplus/cppmodelmanagerbase.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
+#include <utils/qtcfallthrough.h>
#include <utils/runextensions.h>
#include <QDir>
@@ -1391,7 +1392,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
break;
case ViewerContext::AddAllPathsAndDefaultSelectors:
res.selectors.append(defaultVCtx.selectors);
- // fallthrough
+ Q_FALLTHROUGH();
case ViewerContext::AddAllPaths:
{
foreach (const QString &path, defaultVCtx.paths)
@@ -1400,10 +1401,10 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
case Dialect::AnyLanguage:
case Dialect::Qml:
res.maybeAddPath(info.qtQmlPath);
- // fallthrough
+ Q_FALLTHROUGH();
case Dialect::QmlQtQuick1:
res.maybeAddPath(info.qtImportsPath);
- // fallthrough
+ Q_FALLTHROUGH();
case Dialect::QmlQtQuick2:
case Dialect::QmlQtQuick2Ui:
{
@@ -1439,7 +1440,7 @@ ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
}
case ViewerContext::AddDefaultPathsAndSelectors:
res.selectors.append(defaultVCtx.selectors);
- // fallthrough
+ Q_FALLTHROUGH();
case ViewerContext::AddDefaultPaths:
foreach (const QString &path, defaultVCtx.paths)
res.maybeAddPath(path);
diff --git a/src/libs/ssh/sshchannelmanager.cpp b/src/libs/ssh/sshchannelmanager.cpp
index 364d1dcfe24..589cdab73bd 100644
--- a/src/libs/ssh/sshchannelmanager.cpp
+++ b/src/libs/ssh/sshchannelmanager.cpp
@@ -266,7 +266,7 @@ SshTcpIpForwardServer::Ptr SshChannelManager::createForwardServer(const QString
switch (state) {
case SshTcpIpForwardServer::Closing:
m_listeningForwardServers.removeOne(server);
- // fall through
+ Q_FALLTHROUGH();
case SshTcpIpForwardServer::Initializing:
m_waitingForwardServers.append(server);
break;
diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp
index e1f98da06dc..efcded094c4 100644
--- a/src/libs/ssh/sshconnection.cpp
+++ b/src/libs/ssh/sshconnection.cpp
@@ -519,7 +519,7 @@ void SshConnectionPrivate::handleServiceAcceptPacket()
switch (m_connParams.authenticationType) {
case SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods:
m_triedAllPasswordBasedMethods = false;
- // Fall-through.
+ Q_FALLTHROUGH();
case SshConnectionParameters::AuthenticationTypePassword:
m_sendFacility.sendUserAuthByPasswordRequestPacket(m_connParams.userName().toUtf8(),
SshCapabilities::SshConnectionService, m_connParams.password().toUtf8());