forked from qt-creator/qt-creator
C++: Also expand first token after macro define
It was previously beeing skipped. Change-Id: Iadd9b03acbcf0ee0fb4db537b8597661cb93af3f Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1257,16 +1257,22 @@ void Preprocessor::handleDefineDirective(PPToken *tk)
|
||||
QVector<PPToken> bodyTokens;
|
||||
PPToken firstBodyToken = *tk;
|
||||
while (isValidToken(*tk)) {
|
||||
tk->f.generated = true;
|
||||
bodyTokens.push_back(*tk);
|
||||
lex(tk);
|
||||
if (eagerExpansion)
|
||||
if (eagerExpansion) {
|
||||
PPToken idTk = *tk;
|
||||
while (tk->is(T_IDENTIFIER)
|
||||
&& (!tk->newline() || tk->joined())
|
||||
&& !isQtReservedWord(tk->asByteArrayRef())
|
||||
&& handleIdentifier(tk)) {
|
||||
lex(tk);
|
||||
if (tk->asByteArrayRef() == macroName) {
|
||||
*tk = idTk;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
tk->f.generated = true;
|
||||
bodyTokens.push_back(*tk);
|
||||
lex(tk);
|
||||
}
|
||||
|
||||
if (isQtReservedWord(ByteArrayRef(¯oName))) {
|
||||
|
||||
Reference in New Issue
Block a user