summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-04-10 13:38:41 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-16 00:54:19 +0200
commitd2090e19a93fca9b5015d3a6978d7079e1414e13 (patch)
tree38ff69ddd6072abec5e8a87c0b7c54c00f5e7f0c /src/tools/moc
parent83fc52e3b4005d946c731577f8f49becae948c39 (diff)
moc: Fix parsing of the empty preprocessor command
When encountering a null preprocessing directive (which is supposed to be ignored), the moc preprocessor will leave a PP_NEWLINE token in the token stream. That will confuse the parser. The PP_NEWLINE token need to be ignored in the preprocessing phase. Task-number: QTBUG-22717 Change-Id: I1e502a7e5bc6fa8ce2f82109ba7199b95747ff0a Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/preprocessor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 07986a71e6..091f62b379 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -915,6 +915,8 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
case PP_ENDIF:
until(PP_NEWLINE);
continue;
+ case PP_NEWLINE:
+ continue;
case SIGNALS:
case SLOTS: {
Symbol sym = symbol();