Commit f2625935 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

GccParser: Consider multiple definition an error



Change-Id: I0048944f5fda066bc97552a81b57d24f8a14f55d
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 23085895
......@@ -110,7 +110,8 @@ void GccParser::stdError(const QString &line)
if (m_regExp.cap(7) == QLatin1String("warning"))
task.type = Task::Warning;
else if (m_regExp.cap(7) == QLatin1String("error") ||
task.description.startsWith(QLatin1String("undefined reference to")))
task.description.startsWith(QLatin1String("undefined reference to")) ||
task.description.startsWith(QLatin1String("multiple definition of")))
task.type = Task::Error;
// Prepend "#warning" or "#error" if that triggered the match on (warning|error)
......@@ -811,6 +812,33 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
categoryCompile))
<< QString();
QTest::newRow("ld: Multiple definition error")
<< QString::fromLatin1("foo.o: In function `foo()':\n"
"/home/user/test/foo.cpp:2: multiple definition of `foo()'\n"
"bar.o:/home/user/test/bar.cpp:4: first defined here\n"
"collect2: error: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Unknown,
QLatin1String("In function `foo()':"),
Utils::FileName::fromUserInput(QLatin1String("foo.o")), -1,
categoryCompile)
<< Task(Task::Error,
QLatin1String("multiple definition of `foo()'"),
Utils::FileName::fromUserInput(QLatin1String("/home/user/test/foo.cpp")), 2,
categoryCompile)
<< Task(Task::Unknown,
QLatin1String("first defined here"),
Utils::FileName::fromUserInput(QLatin1String("/home/user/test/bar.cpp")), 4,
categoryCompile)
<< Task(Task::Error,
QLatin1String("collect2: error: ld returned 1 exit status"),
Utils::FileName(), -1,
categoryCompile)
)
<< QString();
}
void ProjectExplorerPlugin::testGccOutputParsers()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment