forked from qt-creator/qt-creator
C++: Fix line number information after multiline comments.
Task-number: QTCREATORBUG-7702 Change-Id: I0ec2e1eb9bf1c556b0a426d4405df1c48b5653ed Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -1137,10 +1137,17 @@ void Preprocessor::trackExpansionCycles(PPToken *tk)
|
||||
}
|
||||
}
|
||||
|
||||
static void adjustForCommentNewlines(unsigned *currentLine, const PPToken &tk)
|
||||
{
|
||||
if (tk.is(T_COMMENT) || tk.is(T_DOXY_COMMENT))
|
||||
(*currentLine) += tk.asByteArrayRef().count('\n');
|
||||
}
|
||||
|
||||
void Preprocessor::synchronizeOutputLines(const PPToken &tk, bool forceLine)
|
||||
{
|
||||
if (m_state.m_expansionStatus != NotExpanding
|
||||
|| (!forceLine && m_env->currentLine == tk.lineno)) {
|
||||
adjustForCommentNewlines(&m_env->currentLine, tk);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1157,8 +1164,7 @@ void Preprocessor::synchronizeOutputLines(const PPToken &tk, bool forceLine)
|
||||
}
|
||||
|
||||
m_env->currentLine = tk.lineno;
|
||||
if (tk.is(T_COMMENT) || tk.is(T_DOXY_COMMENT))
|
||||
m_env->currentLine += tk.asByteArrayRef().count('\n');
|
||||
adjustForCommentNewlines(&m_env->currentLine, tk);
|
||||
}
|
||||
|
||||
void Preprocessor::removeTrailingOutputLines()
|
||||
|
||||
Reference in New Issue
Block a user