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:
Christian Kandeler
2022-06-01 16:22:45 +02:00
parent ba693efdd3
commit 51aae3bb1f

View File

@@ -126,8 +126,8 @@ void GccParser::createOrAmendTask(
// 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.
if ((originalLine.endsWith("required from here") || originalLine.endsWith("requested here"))
&& !file.isEmpty() && line > 0) {
if ((originalLine.endsWith("required from here") || originalLine.endsWith("requested here")
|| originalLine.endsWith("note: here")) && !file.isEmpty() && line > 0) {
m_requiredFromHereFound = true;
m_currentTask.setFile(file);
m_currentTask.line = line;
@@ -1398,6 +1398,39 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
FilePath::fromUserInput("tst_addresscache.cpp"), 79, 13, {})}
<< 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")
<< QString(
"cc1plus: error: one or more PCH files were found, but they were invalid\n"