C++: Fix macro uses line info

Make sure the environment line is consistent during preprocessor
directives and identifier handling so clients can rely on consistent
information. Particularly important for macro usages.

New tests also added.

Change-Id: I962a39a86cd17b8d945d2959c2c95e2d258ea3e6
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Leandro Melo
2012-05-29 12:37:55 +02:00
committed by hjk
parent 356d5cab23
commit ca7ac8c035
4 changed files with 85 additions and 17 deletions

View File

@@ -524,9 +524,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset,
if (! m_currentDoc)
return;
//qDebug() << "start expanding:" << macro.name() << "text:" << originalText;
m_currentDoc->addMacroUse(macro, offset, originalText.length(), env.currentLine,
actuals);
m_currentDoc->addMacroUse(macro, offset, originalText.length(), env.currentLine, actuals);
}
void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &)