aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-07-09 17:46:13 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-07-14 07:47:51 +0000
commit69c8221885981c17b8bdeb497076b75edb6e2246 (patch)
treecad62e1f62515441ed64b61bb6842d141ed7edf6
parentf4af71a3dd66afe90464692cadeb02fbd14a3d96 (diff)
GCC Parser: Recognize lines with "cc1plus"
Change-Id: I73a548b58c96fe944a80e36ee72ea9d3965ca6dc Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/projectexplorer/gccparser.cpp32
-rw-r--r--src/plugins/projectexplorer/gccparser.h1
2 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp
index db794e668a..6a2f8a73de 100644
--- a/src/plugins/projectexplorer/gccparser.cpp
+++ b/src/plugins/projectexplorer/gccparser.cpp
@@ -56,6 +56,10 @@ GccParser::GccParser()
+ FILE_PATTERN + "(\\d+)(:\\d+)?[,:]?$");
QTC_CHECK(m_regExpInlined.isValid());
+ m_regExpCc1plus.setPattern(QLatin1Char('^') + "cc1plus.*(error|warning): ((?:"
+ + FILE_PATTERN + " No such file or directory)?.*)");
+ QTC_CHECK(m_regExpCc1plus.isValid());
+
// optional path with trailing slash
// optional arm-linux-none-thingy
// name of executable
@@ -181,6 +185,18 @@ OutputLineParser::Result GccParser::handleLine(const QString &line, OutputFormat
return {Status::InProgress, linkSpecs};
}
+ match = m_regExpCc1plus.match(lne);
+ if (match.hasMatch()) {
+ const Task::TaskType type = match.captured(1) == "error" ? Task::Error : Task::Warning;
+ const FilePath filePath = absoluteFilePath(FilePath::fromUserInput(match.captured(3)));
+ LinkSpecs linkSpecs;
+ if (!filePath.isEmpty())
+ addLinkSpecForAbsoluteFilePath(linkSpecs, filePath, -1, match, 3);
+ createOrAmendTask(type, match.captured(2), lne, false, filePath, -1, linkSpecs);
+ flush();
+ return {Status::Done, linkSpecs};
+ }
+
match = m_regExp.match(lne);
if (match.hasMatch()) {
int lineno = match.captured(3).toInt();
@@ -1182,6 +1198,22 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
" | ^~~~~",
FilePath::fromUserInput("qmap.h"), 110)}
<< QString();
+
+ QTest::newRow("cc1plus")
+ << QString(
+ "cc1plus: error: one or more PCH files were found, but they were invalid\n"
+ "cc1plus: error: use -Winvalid-pch for more information\n"
+ "cc1plus: fatal error: .pch/Qt6Core5Compat: No such file or directory\n"
+ "cc1plus: warning: -Wformat-security ignored without -Wformat [-Wformat-security]\n"
+ "compilation terminated.")
+ << OutputParserTester::STDERR
+ << QString() << QString("compilation terminated.\n")
+ << Tasks{
+ CompileTask(Task::Error, "one or more PCH files were found, but they were invalid"),
+ CompileTask(Task::Error, "use -Winvalid-pch for more information"),
+ CompileTask(Task::Error, ".pch/Qt6Core5Compat: No such file or directory", FilePath::fromString(".pch/Qt6Core5Compat")),
+ CompileTask(Task::Warning, "-Wformat-security ignored without -Wformat [-Wformat-security]")}
+ << QString();
}
void ProjectExplorerPlugin::testGccOutputParsers()
diff --git a/src/plugins/projectexplorer/gccparser.h b/src/plugins/projectexplorer/gccparser.h
index 220fc31444..7e60f103d4 100644
--- a/src/plugins/projectexplorer/gccparser.h
+++ b/src/plugins/projectexplorer/gccparser.h
@@ -65,6 +65,7 @@ private:
QRegularExpression m_regExpIncluded;
QRegularExpression m_regExpInlined;
QRegularExpression m_regExpGccNames;
+ QRegularExpression m_regExpCc1plus;
Task m_currentTask;
LinkSpecs m_linkSpecs;