diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index a19ad120078..89c59443e1b 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -149,13 +149,14 @@ MsvcParser::Result MsvcParser::processCompileLine(const QString &line) if (match.hasMatch()) { QPair position = parseFileName(match.captured(1)); const FilePath filePath = absoluteFilePath(position.first); - LinkSpecs linkSpecs; - addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, position.second, match, 1); + LinkSpecs lineLinkSpecs; + addLinkSpecForAbsoluteFilePath(lineLinkSpecs, filePath, position.second, match, 1); + LinkSpecs detailsLinkSpecs = lineLinkSpecs; if (!m_lastTask.isNull() && line.contains("note: ")) { const int offset = std::accumulate(m_lastTask.details.cbegin(), m_lastTask.details.cend(), 0, [](int total, const QString &line) { return total + line.length() + 1;}); - for (LinkSpec &ls : linkSpecs) + for (LinkSpec &ls : detailsLinkSpecs) ls.startPos += offset; ++m_lines; } else { @@ -165,9 +166,9 @@ MsvcParser::Result MsvcParser::processCompileLine(const QString &line) filePath, position.second); m_lines = 1; } - m_linkSpecs << linkSpecs; + m_linkSpecs << detailsLinkSpecs; m_lastTask.details.append(line); - return {Status::InProgress, linkSpecs}; + return {Status::InProgress, lineLinkSpecs}; } flush();