C++: Fix line value for tokens generated by function-like macro

baseLine is used for generating new tokens, which are
later added m_state.m_lineRef - 1 again

Change-Id: I33928a90988e8d4c317ae460647f16f87da5b155
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-02-20 22:14:18 +02:00
committed by Orgad Shaneh
parent e4c2f569a8
commit b41b25a3f7

View File

@@ -969,7 +969,7 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
// their corresponding argument in macro substitution. For expanded tokens which are
// generated, this information must be taken from somewhere else. What we do is to keep
// a "reference" line initialize set to the line where expansion happens.
unsigned baseLine = idTk.lineno;
unsigned baseLine = idTk.lineno - m_state.m_lineRef + 1;
QVector<PPToken> body = macro->definitionTokens();