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>
This commit is contained in:
Olivier Goffart 2012-04-10 13:38:41 +02:00 committed by Qt by Nokia
parent 83fc52e3b4
commit d2090e19a9
2 changed files with 9 additions and 0 deletions

View File

@ -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();

View File

@ -368,6 +368,13 @@ signals:
void signalInIf3();
#endif
# //QTBUG-22717
# /* */
#
# \
//
public slots:
void const slotWithSillyConst() {}