forked from qt-creator/qt-creator
GccParser: Consider multiple definition an error
Change-Id: I0048944f5fda066bc97552a81b57d24f8a14f55d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
23085895d6
commit
f262593596
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user