forked from qt-creator/qt-creator
GccParser: Check for "note: here" output
Much like "requested from here", it usually indicates the interesting location. Change-Id: I7db2c8f0a8e5d0ebafedbaaf5cbd04f07055dfe9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -126,8 +126,8 @@ void GccParser::createOrAmendTask(
|
|||||||
|
|
||||||
// If a "required from here" line is present, it is almost always the cause of the problem,
|
// If a "required from here" line is present, it is almost always the cause of the problem,
|
||||||
// so that's where we should go when the issue is double-clicked.
|
// so that's where we should go when the issue is double-clicked.
|
||||||
if ((originalLine.endsWith("required from here") || originalLine.endsWith("requested here"))
|
if ((originalLine.endsWith("required from here") || originalLine.endsWith("requested here")
|
||||||
&& !file.isEmpty() && line > 0) {
|
|| originalLine.endsWith("note: here")) && !file.isEmpty() && line > 0) {
|
||||||
m_requiredFromHereFound = true;
|
m_requiredFromHereFound = true;
|
||||||
m_currentTask.setFile(file);
|
m_currentTask.setFile(file);
|
||||||
m_currentTask.line = line;
|
m_currentTask.line = line;
|
||||||
@@ -1398,6 +1398,39 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
|
|||||||
FilePath::fromUserInput("tst_addresscache.cpp"), 79, 13, {})}
|
FilePath::fromUserInput("tst_addresscache.cpp"), 79, 13, {})}
|
||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
|
QTest::newRow(R"("note: here")")
|
||||||
|
<< QString(
|
||||||
|
"In file included from qmlprofilerstatisticsmodel.h:31,\n"
|
||||||
|
" from qmlprofilerstatisticsmodel.cpp:26:\n"
|
||||||
|
"qmlprofilerstatisticsmodel.cpp: In member function ‘virtual QVariant QmlProfiler::QmlProfilerStatisticsModel::data(const QModelIndex&, int) const’:\n"
|
||||||
|
"qtcassert.h:43:34: warning: this statement may fall through [-Wimplicit-fallthrough=]\n"
|
||||||
|
" 43 | #define QTC_ASSERT(cond, action) if (Q_LIKELY(cond)) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)\n"
|
||||||
|
" | ^~\n"
|
||||||
|
"qtcassert.h:43:34: note: in definition of macro ‘QTC_ASSERT’\n"
|
||||||
|
" 43 | #define QTC_ASSERT(cond, action) if (Q_LIKELY(cond)) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)\n"
|
||||||
|
" | ^~\n"
|
||||||
|
"qmlprofilerstatisticsmodel.cpp:365:5: note: here\n"
|
||||||
|
" 365 | default:\n"
|
||||||
|
" | ^~~~~~~")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< Tasks{compileTask(Task::Warning,
|
||||||
|
"this statement may fall through [-Wimplicit-fallthrough=]\n"
|
||||||
|
"In file included from qmlprofilerstatisticsmodel.h:31,\n"
|
||||||
|
" from qmlprofilerstatisticsmodel.cpp:26:\n"
|
||||||
|
"qmlprofilerstatisticsmodel.cpp: In member function ‘virtual QVariant QmlProfiler::QmlProfilerStatisticsModel::data(const QModelIndex&, int) const’:\n"
|
||||||
|
"qtcassert.h:43:34: warning: this statement may fall through [-Wimplicit-fallthrough=]\n"
|
||||||
|
" 43 | #define QTC_ASSERT(cond, action) if (Q_LIKELY(cond)) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)\n"
|
||||||
|
" | ^~\n"
|
||||||
|
"qtcassert.h:43:34: note: in definition of macro ‘QTC_ASSERT’\n"
|
||||||
|
" 43 | #define QTC_ASSERT(cond, action) if (Q_LIKELY(cond)) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)\n"
|
||||||
|
" | ^~\n"
|
||||||
|
"qmlprofilerstatisticsmodel.cpp:365:5: note: here\n"
|
||||||
|
" 365 | default:\n"
|
||||||
|
" | ^~~~~~~",
|
||||||
|
FilePath::fromUserInput("qmlprofilerstatisticsmodel.cpp"), 365, 5, {})}
|
||||||
|
<< QString();
|
||||||
|
|
||||||
QTest::newRow("cc1plus")
|
QTest::newRow("cc1plus")
|
||||||
<< QString(
|
<< QString(
|
||||||
"cc1plus: error: one or more PCH files were found, but they were invalid\n"
|
"cc1plus: error: one or more PCH files were found, but they were invalid\n"
|
||||||
|
Reference in New Issue
Block a user