From 9f888d2fde9c5413e5519e0914e9b13638760985 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 27 Jun 2016 15:43:33 +0200 Subject: 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 --- src/tools/moc/preprocessor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tools/moc/preprocessor.cpp') 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; -- cgit v1.2.3