summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-11-18 09:39:17 +0200
committerOrgad Shaneh <orgads@gmail.com>2013-11-18 10:11:28 +0100
commita3535e667e457abecdc776db8113814c1164e137 (patch)
treefd6d842169840d146390f295285efe0c4b6e7319 /src
parent920fa79667f962270fe85a863d90f950b63560f0 (diff)
downloadqt-creator-a3535e667e457abecdc776db8113814c1164e137.tar.gz
MsvcParser: Correctly parse ambiguous symbol error
Change-Id: I27a4e2e43209887b26c42163dd3234672c42967e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/msvcparser.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp
index 653d9e30f7..8244363a6d 100644
--- a/src/plugins/projectexplorer/msvcparser.cpp
+++ b/src/plugins/projectexplorer/msvcparser.cpp
@@ -70,8 +70,7 @@ MsvcParser::MsvcParser()
+ QLatin1String(ERROR_PATTERN) + QLatin1String(".*)$"));
m_compileRegExp.setMinimal(true);
QTC_CHECK(m_compileRegExp.isValid());
- m_additionalInfoRegExp.setPattern(QString::fromLatin1("^ (.*)\\((\\d+)\\) : (.*)$"));
- m_additionalInfoRegExp.setMinimal(true);
+ m_additionalInfoRegExp.setPattern(QString::fromLatin1("^ (?:(could be |or )\\s*')?(.*)\\((\\d+)\\) : (.*)$"));
QTC_CHECK(m_additionalInfoRegExp.isValid());
}
@@ -123,10 +122,13 @@ void MsvcParser::stdOutput(const QString &line)
return;
}
if (infoPos > -1) {
- m_lastTask = Task(Task::Unknown,
- m_additionalInfoRegExp.cap(3).trimmed(), /* description */
- Utils::FileName::fromUserInput(m_additionalInfoRegExp.cap(1)), /* fileName */
- m_additionalInfoRegExp.cap(2).toInt(), /* linenumber */
+ QString description = m_additionalInfoRegExp.cap(1)
+ + m_additionalInfoRegExp.cap(4).trimmed();
+ if (!m_additionalInfoRegExp.cap(1).isEmpty())
+ description.chop(1); // Remove trailing quote
+ m_lastTask = Task(Task::Unknown, description,
+ Utils::FileName::fromUserInput(m_additionalInfoRegExp.cap(2)), /* fileName */
+ m_additionalInfoRegExp.cap(3).toInt(), /* linenumber */
Constants::TASK_CATEGORY_COMPILE);
return;
}
@@ -362,6 +364,27 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
Utils::FileName::fromUserInput(QLatin1String("symbolgroupvalue.cpp")), 2314,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
+
+ QTest::newRow("Ambiguous symbol")
+ << QString::fromLatin1("D:\\Project\\file.h(98) : error C2872: 'UINT64' : ambiguous symbol\n"
+ " could be 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\basetsd.h(83) : unsigned __int64 UINT64'\n"
+ " or 'D:\\Project\\types.h(71) : Types::UINT64'")
+ << OutputParserTester::STDOUT
+ << QString() << QString()
+ << (QList<Task>()
+ << Task(Task::Error,
+ QLatin1String("C2872: 'UINT64' : ambiguous symbol"),
+ Utils::FileName::fromUserInput(QLatin1String("D:\\Project\\file.h")), 98,
+ Constants::TASK_CATEGORY_COMPILE)
+ << Task(Task::Unknown,
+ QLatin1String("could be unsigned __int64 UINT64"),
+ Utils::FileName::fromUserInput(QLatin1String("C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\basetsd.h")), 83,
+ Constants::TASK_CATEGORY_COMPILE)
+ << Task(Task::Unknown,
+ QLatin1String("or Types::UINT64"),
+ Utils::FileName::fromUserInput(QLatin1String("D:\\Project\\types.h")), 71,
+ Constants::TASK_CATEGORY_COMPILE))
+ << QString();
}
void ProjectExplorerPlugin::testMsvcOutputParsers()