diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 15:43:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-19 18:38:53 +0000 |
commit | 9f888d2fde9c5413e5519e0914e9b13638760985 (patch) | |
tree | 7e211a2ae70c272ea8041d5100f0c9a67b32de1b /src/tools | |
parent | 25dd9c521fc064a71db63b110b7973225ee20c02 (diff) |
Support C++17 fallthrough attribute
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/moc.cpp | 2 | ||||
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 10 | ||||
-rw-r--r-- | src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 87fb1318f9..afe64bb889 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -163,7 +163,7 @@ Type Moc::parseType() case SIGNED: case UNSIGNED: hasSignedOrUnsigned = true; - // fall through + Q_FALLTHROUGH(); case CONST: case VOLATILE: type.name += lexem(); diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 415003e6b1..5ce28d931b 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -251,7 +251,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso } token = FLOATING_LITERAL; ++data; - // fall through + Q_FALLTHROUGH(); case FLOATING_LITERAL: while (is_digit_char(*data)) ++data; @@ -321,7 +321,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso ++data; } token = WHITESPACE; // one comment, one whitespace - // fall through; + Q_FALLTHROUGH(); case WHITESPACE: if (column == 1) column = 0; @@ -428,7 +428,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso } token = PP_FLOATING_LITERAL; ++data; - // fall through + Q_FALLTHROUGH(); case PP_FLOATING_LITERAL: while (is_digit_char(*data)) ++data; @@ -482,7 +482,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso ++data; } token = PP_WHITESPACE; // one comment, one whitespace - // fall through; + Q_FALLTHROUGH(); case PP_WHITESPACE: while (*data && (*data == ' ' || *data == '\t')) ++data; @@ -1177,7 +1177,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) case PP_ELIF: case PP_ELSE: skipUntilEndif(); - // fall through + Q_FALLTHROUGH(); case PP_ENDIF: until(PP_NEWLINE); continue; diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp index 083187555d..26e7b086d9 100644 --- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp +++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp @@ -335,28 +335,28 @@ static void parseCmdLine(QStringList &arguments) switch (c) { case 'P': flags |= QDBusConnection::ExportNonScriptableProperties; - // fall through + Q_FALLTHROUGH(); case 'p': flags |= QDBusConnection::ExportScriptableProperties; break; case 'S': flags |= QDBusConnection::ExportNonScriptableSignals; - // fall through + Q_FALLTHROUGH(); case 's': flags |= QDBusConnection::ExportScriptableSignals; break; case 'M': flags |= QDBusConnection::ExportNonScriptableSlots; - // fall through + Q_FALLTHROUGH(); case 'm': flags |= QDBusConnection::ExportScriptableSlots; break; case 'A': flags |= QDBusConnection::ExportNonScriptableContents; - // fall through + Q_FALLTHROUGH(); case 'a': flags |= QDBusConnection::ExportScriptableContents; break; |