Skip to content
Snippets Groups Projects
Commit 503b3534 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix wrong task type returned by gccparser

 * Fix "instantiated from" with leading spaces being wrongly considered
   an error.
 * Add a unit test to cover this case
parent 615cda84
No related branches found
No related tags found
No related merge requests found
......@@ -515,6 +515,38 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
QString(), -1,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("instantiated from here should not be an error")
<< QString::fromLatin1("../stl/main.cpp: In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:\n"
"../stl/main.cpp:38: instantiated from here\n"
"../stl/main.cpp:31: warning: returning reference to temporary\n"
"../stl/main.cpp: At global scope:\n"
"../stl/main.cpp:31: warning: unused parameter index")
<< OutputParserTester::STDERR
<< QString() << QString()
<< ( QList<ProjectExplorer::Task>()
<< Task(Task::Unknown,
QLatin1String("In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:"),
QLatin1String("../stl/main.cpp"), -1,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Unknown,
QLatin1String("instantiated from here"),
QLatin1String("../stl/main.cpp"), 38,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Warning,
QLatin1String("returning reference to temporary"),
QLatin1String("../stl/main.cpp"), 31,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Unknown,
QLatin1String("At global scope:"),
QLatin1String("../stl/main.cpp"), -1,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Warning,
QLatin1String("unused parameter index"),
QLatin1String("../stl/main.cpp"), 31,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
}
void ProjectExplorerPlugin::testGccOutputParsers()
......
......@@ -89,7 +89,7 @@ void LdParser::stdError(const QString &line)
int lineno = m_regExpLinker.cap(4).toInt(&ok);
if (!ok)
lineno = -1;
QString description = m_regExpLinker.cap(5);
QString description = m_regExpLinker.cap(5).trimmed();
Task task(Task::Error,
description,
m_regExpLinker.cap(1) /* filename */,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment